Skip to content

Commit

Permalink
Replace gnu_printf with printf in format __attribute__
Browse files Browse the repository at this point in the history
The gnu_printf format attribute was being picked up by clang as
well as gcc. Only gcc defines gnu_printf. Switching to only
'printf' to support clang as well.
  • Loading branch information
brarcher committed Jun 28, 2020
1 parent cbf4dcd commit 2493adc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/check.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,11 @@ static void __testname ## _fn (int _i CK_ATTRIBUTE_UNUSED)
#if @HAVE_FORK@
CK_DLL_EXP void CK_EXPORT _ck_assert_failed(const char *file, int line,
const char *expr, const char *msg,
...) CK_ATTRIBUTE_NORETURN CK_ATTRIBUTE_FORMAT(gnu_printf, 4, 5);
...) CK_ATTRIBUTE_NORETURN CK_ATTRIBUTE_FORMAT(printf, 4, 5);
#else
CK_DLL_EXP void CK_EXPORT _ck_assert_failed(const char *file, int line,
const char *expr, const char *msg,
...) CK_ATTRIBUTE_FORMAT(gnu_printf, 4, 5);
...) CK_ATTRIBUTE_FORMAT(printf, 4, 5);
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion src/check_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extern jmp_buf error_jmp_buffer;
/* Print error message and die
If fmt ends in colon, include system error information */
void eprintf(const char *fmt, const char *file, int line,
...) CK_ATTRIBUTE_NORETURN CK_ATTRIBUTE_FORMAT(gnu_printf, 1, 4);
...) CK_ATTRIBUTE_NORETURN CK_ATTRIBUTE_FORMAT(printf, 1, 4);
/* malloc or die */
void *emalloc(size_t n);
void *erealloc(void *, size_t n);
Expand Down
2 changes: 1 addition & 1 deletion src/check_str.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ char *tr_short_str(TestResult * tr);
*/
char *sr_stat_str(SRunner * sr);

char *ck_strdup_printf(const char *fmt, ...) CK_ATTRIBUTE_FORMAT(gnu_printf, 1, 2);
char *ck_strdup_printf(const char *fmt, ...) CK_ATTRIBUTE_FORMAT(printf, 1, 2);

#endif /* CHECK_STR_H */

0 comments on commit 2493adc

Please sign in to comment.