https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85949
Bug ID: 85949 Summary: __attribute__ ((format (printf,1,1))); improve error messages Product: gcc Version: 8.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: jg at jguk dot org Target Milestone: --- Created attachment 44195 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44195&action=edit main Hello This is very useful! Could the build errors be clearer? I found this online which describes the parameter order https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax Also, could the carat be accurate on the output, it is stuck at char 1. I included two examples (2,3) and (1,1) below It would actually require (1,2) to compile. Output: ~$ gcc -o main main.c -Wall -Werror -Wconversion main.c:7:1: error: format string argument is not a string type void str_fmt(const char * const format, ...) __attribute__ ((format (printf,2,3))); ^ jonny@asus:~$ gcc -o main main.c -Wall -Werror -Wconversion main.c:7:1: error: format string argument follows the args to be formatted void str_fmt(const char * const format, ...) __attribute__ ((format (printf,1,1))); ^ Expected: jonny@asus:~$ gcc -o main main.c -Wall -Werror -Wconversion main.c:7:1: error: format string argument variadic list follows the args to be formatted void str_fmt(const char * const format, ...) __attribute__ ((format (printf,1,1))); ^ ~$ gcc -o main main.c -Wall -Werror -Wconversion main.c:7:78: error: format string argument ‘2’ is not a string type void str_fmt(const char * const format, ...) __attribute__ ((format (printf,2,3))); ^ main.c:7:80: error: format string argument ‘3’ is not present void str_fmt(const char * const format, ...) __attribute__ ((format (printf,2,3))); ^