https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106039

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I don't see an issue with the diagnostic here really.

For the single line case (without the format as a macro):
    printf("%-21s %-16x %-16x %-18s %-18s\n", "GHI", (intptr_t) val1,
(intptr_t) val1, "ABC", "DEF");


We get:

<source>:22:23: warning: format '%x' expects argument of type 'unsigned int',
but argument 3 has type 'long int' [-Wformat=]
   22 |     printf("%-21s %-16x %-16x %-18s %-18s\n", "GHI", (intptr_t) val1,
(intptr_t) val1, "ABC", "DEF");
      |                   ~~~~^                              ~~~~~~~~~~~~~~~
      |                       |                              |
      |                       unsigned int                   long int
      |                   %-16lx
<source>:22:29: warning: format '%x' expects argument of type 'unsigned int',
but argument 4 has type 'long int' [-Wformat=]
   22 |     printf("%-21s %-16x %-16x %-18s %-18s\n", "GHI", (intptr_t) val1,
(intptr_t) val1, "ABC", "DEF");
      |                         ~~~~^                                        
~~~~~~~~~~~~~~~
      |                             |                                         |
      |                             unsigned int                             
long int
      |                         %-16lx

are you asking to point out where the arguments were for the macro case?

Reply via email to