As in warning: missing sentinel in function call
As in warning: missing sentinel in function call
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Post your example.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
How have you declared your function. Also what is the line above that error? As that will note the function call your in.
Please always paste code as well.
If this is all you have then simply googling the error would produce better results for you.
I didn't know the question was so complicated, or that the definition of "sentinel" would be contained in my code, but:
edit: okay I googled it. "error_popup" doesn't involve a sentinel tho...this is a -Wall error...Code:pid = fork(); if (pid <0) {error_popup("fork() failed in \"tonote()\""); return;}
Last edited by MK27; 12-05-2008 at 11:39 AM.
hmm... I am still not sure what is the problem. Generally "sentinel" refers to some kind of flag, e.g., a flag used to control a loop. Why not post the smallest and simplest code that demonstrates the problem?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
It's truly amazing what "da interweb" and a search for an error message in the manual will reveal...
Short answer, your exec call is missing NULL.sentinel
This function attribute ensures that a parameter in a function call is an explicit NULL. The attribute is only valid on variadic functions. By default, the sentinel is located at position zero, the last parameter of the function call. If an optional integer position argument P is supplied to the attribute, the sentinel must be located at position P counting backwards from the end of the argument list.
__attribute__ ((sentinel))
is equivalent to
__attribute__ ((sentinel(0)))
The attribute is automatically set with a position of 0 for the built-in functions execl and execlp. The built-in function execle has the attribute set with a position of 1.
A valid NULL in this context is defined as zero with any pointer type. If your system defines the NULL macro with an integer type then you need to add an explicit cast. GCC replaces stddef.h with a copy that redefines NULL appropriately.
The warnings for missing or incorrect sentinels are enabled with -Wformat.
Or whatever...
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge