GNOME Bugzilla – Bug 529488
[sidplay] Missing sentinel in function call
Last modified: 2008-04-25 23:10:43 UTC
Hi, current -ugly CVS produces a compiler warnings in gstsiddec.cc: cc1plus: warnings being treated as errors gstsiddec.cc: In function 'void update_tags(GstSidDec*)': gstsiddec.cc:302: warning: missing sentinel in function call gstsiddec.cc:306: warning: missing sentinel in function call gstsiddec.cc:310: warning: missing sentinel in function call This is with gcc version 4.2.1 20070719 [FreeBSD]. The lines in question are like: gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, GST_TAG_TITLE, info.nameString, NULL); So a sentinel is actually there unless I'm missing something. Is this just a compiler bug?
Hm, the g++ docs suggest that you can't use NULL as a sentinel in C++: -Wstrict-null-sentinel (C++ only) Warn also about the use of an uncasted NULL as sentinel. When compiling only with GCC this is a valid sentinel, as NULL is defined to __null. Although it is a null pointer constant not a null pointer, it is guaranteed to of the same size as a pointer. But this use is not portable across different compilers. 2008-04-26 Sebastian Dröge <slomo@circular-chaos.org> * ext/sidplay/gstsiddec.cc: Cast NULL sentinels to void * as NULL is defined as an integer constant in most environments when using C++ and it's size might be different from a pointer. Fixes #529488.