tinyos / nesc

Master nesc repository
GNU General Public License v2.0
100 stars 53 forks source link

Fix building with -Werror=format-security #40

Closed ppisar closed 6 years ago

ppisar commented 7 years ago

When buildling with -Wall -Werror=format-security, fatal warnings arise like this:

gcc -I. -I. -I./../include -I./include -O2 -g -pipe -Wall -Werror=format-security -Wp,-D _FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord -gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -I. -I. -I./../include -I./include -c -o macro.o -MT macro.o -MMD -MP -MF .deps/macro.Po macro.c [...] macro.c: In function ‘create_iso_definition’: macro.c:1576:8: error: format not a string literal and no format arguments [-Werror=format-security] cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg); ^~~~~ macro.c:1589:8: error: format not a string literal and no format arguments [-Werror=format-security] cpp_error (pfile, CPP_DL_ERROR, paste_op_error_msg); ^~~~~

This patch fixes them.