Skip to content

Commit

Permalink
Fixed GCC 6 compatibility issue with -pedantic
Browse files Browse the repository at this point in the history
  • Loading branch information
ludocode committed Jan 11, 2016
1 parent af093a2 commit 71980b8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mpack/mpack-platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,14 @@ MPACK_HEADER_START
#if defined(__GNUC__)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#ifndef __cplusplus
#if __GNUC__ >= 5
#define MPACK_IGNORE_PEDANTIC "GCC diagnostic ignored \"-Wpedantic\""
#else
#define MPACK_IGNORE_PEDANTIC "GCC diagnostic ignored \"-pedantic\""
#endif
#define MPACK_STATIC_ASSERT(expr, str) do { \
_Pragma ("GCC diagnostic push") \
_Pragma ("GCC diagnostic ignored \"-pedantic\"") \
_Pragma (MPACK_IGNORE_PEDANTIC) \
_Pragma ("GCC diagnostic ignored \"-Wc++-compat\"") \
_Static_assert(expr, str); \
_Pragma ("GCC diagnostic pop") \
Expand Down

0 comments on commit 71980b8

Please sign in to comment.