2 ms·
I actually really like the old style function definitions: foo(a, b) int a, b; { } I was mildly disappointed when this was [relatively recentl
by asveikau 11y ago
I actually really like the old style function definitions:
foo(a, b)
int a, b;
{
}
I was mildly disappointed when this was [relatively recently - maybe 10 years ago?] taken out of g++. (Not sure what its status has been in the language standard.) Sure, it's a WTF to most people. But if you have really long type names used more than once, it actually saves typing.
- jhallenworld 11y agoVerilog which is loosely based on C also blindly followed this trend, but created a big mess. In Verilog you can say: module foo(a); parameter width = 20; input [width-1:0] a; But "ANSI" Verilog is "improved": module foo(input [19:0] a); Oops.. no place to put the parameter.. so later on they amended: module #(parameter width=20) foo(input [width-1:0] a); They should have just removed the argument list: module foo; input a; This would have worked for C as well: int foo() int a, b, c; {