This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Warning for unadorned 0 in varargs lists?


This would generate the minimum number of false positives, but wouldn't
catch a bunch of errors, or errors on most user functions. I'd be
happy even with a version of the warning that required me to write
"(int) 0" when I meant the integer zero (in varargs lists only).

But if the attribute approach were followed, the user can add her own attributes to do checking for execl-like functions. This is already easily done for nonstandard printf-like functions.

Yes, the attribute approach is better. But the particular function that's giving me problems has a "type" like
int (*)(void*, int, int, [const char*, int]*, const char* = 0)
so it's not execl-like.


An attribute that said "the last argument must be a pointer", as Florian Weimer suggests, *would* work.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]