News for hackers. Stuff that matters.
Re:Massacring C Pointers (2018) by ramshorns on Saturday September 05, 2020 @12:48AM (#24381472)
Is it equivalent? Because that seems to be the only difference between the two editions for the newprint function, and the author says one of them happens to compile.

https://wozniak.ca/blog/2018/06/25/1/code.html

Re:Massacring C Pointers (2018) by account42 on Monday September 07, 2020 @07:30AM (#24398654)
Yes, the declarations are equivalent.

The difference is the function prototype `void newprint(char *, int);` at the start, which is missing in the second example. With the forward declaration, the compiler knows what arguments newprint takes and errors out if you pass something else. C is compiled top to bottom so in the older version of the example the compiler has no way of knowing what number of arguments the function takes at the point whree it is called. In (not so) old versions of C that implicitly declared a function taking whatever you passed it.