Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C strange warning.

Name: Anonymous 2010-07-01 18:34

http://pastebin.com/3js28CTR
$> gcc main.c
If tata(char|short|float c) => warning
If tata(int|long|double c) => nothing

Does somebody could explain why exactly ? =)

Name: Anonymous 2010-07-05 0:30

>>33
I consider having no function prototype as having the arguments not yet specified.
So does the compiler. This is why you should use (void).

>>34
Fail, again. Why the fuck do you think OP is getting these warnings?? If you declare with (), it means argument promotion. How are you still arguing this point when the whole reason this thread exists is because your suggestion generates compiler warnings and invalid code?

There is another good reason to always use (void) instead of (). Let's say you change a function from taking one argument to taking none. If you change the prototype to (), you won't get any warning or error for existing function calls that send in an argument. This is because () literally means "unspecified arguments"; you can call it with whatever you want. The results are undefined but the compiler is not required to diagnose this error.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List