3 ms·
GCC has -Wstrict-prototypes.
by khaled 9y ago
GCC has -Wstrict-prototypes.
- iainmerrick 9y agoStrange that that isn't included in -Wall! I knew -Wall isn't the same as -Weverything, but I'm always surprised at what it omits. Why wouldn't you want that warning? Edit to add: Aha, my 'gcc' was actually Clang because I'm on OS X. Installing the real GCC, I find: gcc -Wstrict-prototypes does what I want and disallows this feature. But -Wall doesn't include that flag, and GCC doesn't seem to have -Weverything. Clang accepts -Wstrict-prototypes but doesn't catch no-arg functions! That's bad. Even with -Weverything, Clang lets you do anything you want with no-arg functions. Very bad.
- khaled 9y agoI think it is not included in -Wall because such prototype are legitimate pre-ANSI K&R C function prototypes.
- iainmerrick 9y agoHmm, could be! Maybe explicitly specifying a newer standard might do the trick then. I'll try a few things.