Try compiling the following two source with -combine -Wformat and you will end of with an error which is wrong: --- file1.c ---
typedef long long __gcc_host_wide_int__; typedef struct location_s { const char *file; int line; } location_t; union tree_node; typedef union tree_node *tree; extern int diag (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))) __attribute__ ((__nonnull__));; void foo (location_t *loc) { diag ("%H", loc); } ---- end ---- ---- file2.c ---- typedef long long __gcc_host_wide_int__; typedef struct location_s { const char *file; int line; } location_t; union tree_node; typedef union tree_node *tree; extern int diag (const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 1, 2))) __attribute__ ((__nonnull__));; void foo1 (location_t *loc) { diag ("%H", loc); } ---- end ---- -- Summary: gcc_diag does not work with -combine Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: diagnostic, build Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23103