diff options
-rw-r--r-- | diag-control.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/diag-control.h b/diag-control.h index 12770361..270a5852 100644 --- a/diag-control.h +++ b/diag-control.h @@ -120,13 +120,14 @@ * shadowing the global declaration. * * So, if the compiler warns about that, we turn off -Wshadow warnings. + * + * In addition, the generated code may have functions with unreachable + * code, so suppress warnings about those. */ #if defined(_MSC_VER) /* * This is Microsoft Visual Studio; we can use * __pragma(warning(disable:XXXX)) and __pragma(warning(push/pop)). - * - * Suppress unreachable code warnings. */ #define DIAG_OFF_BISON_BYACC \ __pragma(warning(push)) \ @@ -166,6 +167,9 @@ #else /* * Bison. + * + * The generated code may have functions with unused parameters and + * unreachable code, so suppress warnings about those. */ #if defined(_MSC_VER) /* @@ -188,6 +192,7 @@ */ #define DIAG_OFF_BISON_BYACC \ PCAP_DO_PRAGMA(clang diagnostic push) \ + PCAP_DO_PRAGMA(clang diagnostic ignored "-Wunused-parameter") \ PCAP_DO_PRAGMA(clang diagnostic ignored "-Wunreachable-code") #define DIAG_ON_BISON_BYACC \ PCAP_DO_PRAGMA(clang diagnostic pop) @@ -199,6 +204,7 @@ */ #define DIAG_OFF_BISON_BYACC \ PCAP_DO_PRAGMA(GCC diagnostic push) \ + PCAP_DO_PRAGMA(GCC diagnostic ignored "-Wunused-parameter") \ PCAP_DO_PRAGMA(GCC diagnostic ignored "-Wunreachable-code") #define DIAG_ON_BISON_BYACC \ PCAP_DO_PRAGMA(GCC diagnostic pop) |