Skip to content

Commit

Permalink
Avoid gnu_printf attribute when using Clang
Browse files Browse the repository at this point in the history
Clang does not support gnu_printf, so just use printf when using it to
compile.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Message-Id: <20191120210422.61327-1-emaste@freefall.freebsd.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
emaste authored and dgibson committed Nov 21, 2019
1 parent 7430009 commit 34c8227
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
*/

#ifdef __GNUC__
#ifdef __clang__
#define PRINTF(i, j) __attribute__((format (printf, i, j)))
#else
#define PRINTF(i, j) __attribute__((format (gnu_printf, i, j)))
#endif
#define NORETURN __attribute__((noreturn))
#else
#define PRINTF(i, j)
Expand Down

0 comments on commit 34c8227

Please sign in to comment.