Years and years ago, I went to a mess of trouble to implement this specialized warning so I would not have to see it anymore. I use a code generator that puts constant strings into one huge buffer with all the contained strings NUL separated. Today, I was trying to build on OS/X:
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../lib -g -O2 -Wcast-align -Wmissing-prototypes -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings -Wno-format-contains-nul -fno-strict-aliasing -Wstrict-aliasing=2 -MT libopts_la-libopts.lo -MD -MP -MF .deps/libopts_la-libopts.Tpo -c libopts.c -fno-common -DPIC -o .libs/libopts_la-libopts.o warning: unknown warning option '-Wno-format-contains-nul' [-Wunknown-warning-option] In file included from libopts.c:26: ./enum.c:112:38: warning: format string contains '\0' within the string body [-Wformat] fprintf(option_usage_fp, ENUM_ERR_LINE, *(paz_names++)); ^~~~~~~~~~~~~ ./ao-strs.h:70:31: note: expanded from macro 'ENUM_ERR_LINE' #define ENUM_ERR_LINE (ao_strs_strtable+304) ^~~~~~~~~~~~~~~~~~~~~~ ./ao-strs.c:90:20: note: format string is defined here /* 304 */ " %s\n\0" ~~~~~~~~~~~~~~~~~~~^~~ Did somebody go to a bunch of trouble to undo my work for the OS/X platform? :( -- - Bruce