[pragma] Reorg again

https://github.com/harfbuzz/harfbuzz/issues/1546
This commit is contained in:
Behdad Esfahbod 2019-01-18 09:28:22 -05:00
parent c04272fac8
commit 2bd530d598
1 changed files with 46 additions and 45 deletions

View File

@ -31,24 +31,24 @@
#ifndef HB_NO_DIAGNOSTIC_PRAGMAS
/* Rules:
* - We set all pragmas under GCC, even clang-specific ones. Clang
* still reads them.
* - If GCC understands a warning, we declare it as GCC. Otherwise, clang.
* - Within each category, keep sorted.
* - Warnings whose scope can be expanded in future compiler versions shall
* be declared as "warning". Otherwise, either ignored or error.
*/
/* Setup */
#pragma GCC diagnostic warning "-Wall"
#pragma GCC diagnostic warning "-Wextra"
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma clang diagnostic ignored "-Wunknown-warning-option"
//#pragma GCC diagnostic warning "-Weverything"
/* Error */
/* Error. Should never happen. */
#pragma GCC diagnostic error "-Wcast-align"
#pragma GCC diagnostic error "-Wformat-security"
#pragma GCC diagnostic error "-Winit-self"
#pragma GCC diagnostic error "-Wimplicit-function-declaration"
#pragma GCC diagnostic error "-Wmissing-braces"
#pragma GCC diagnostic error "-Wmissing-declarations"
#pragma GCC diagnostic error "-Wmissing-noreturn"
#pragma GCC diagnostic error "-Wmissing-prototypes"
#pragma GCC diagnostic error "-Wnested-externs"
#pragma GCC diagnostic error "-Wold-style-definition"
@ -58,7 +58,7 @@
#pragma GCC diagnostic error "-Wswitch-enum"
#pragma GCC diagnostic error "-Wunused"
#pragma GCC diagnostic error "-Wwrite-strings"
/* Warning */
/* Warning. To be investigated if happens. */
#pragma GCC diagnostic warning "-Wdisabled-optimization"
#pragma GCC diagnostic warning "-Wformat=2"
#pragma GCC diagnostic warning "-Wlogical-op"
@ -66,19 +66,20 @@
#pragma GCC diagnostic warning "-Wsign-compare"
#pragma GCC diagnostic warning "-Wundef"
#pragma GCC diagnostic warning "-Wvla"
/* Ignored */
#pragma GCC diagnostic ignored "-Wclass-memaccess"
/* Ignored currently, but should be fixed at some point. */
#pragma GCC diagnostic ignored "-Wconversion" // TODO fix
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
#pragma GCC diagnostic ignored "-Wformat-signedness" // TODO fix
#pragma GCC diagnostic ignored "-Wshadow" // TODO fix
#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations" // TODO fix
#pragma GCC diagnostic ignored "-Wunused-parameter" // TODO fix
/* Ignored intentionally. */
#pragma clang diagnostic ignored "-Wclass-memaccess"
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
#pragma GCC diagnostic ignored "-Wformat-zero-length"
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#pragma GCC diagnostic ignored "-Wpacked" // Erratic impl in clang
#pragma GCC diagnostic ignored "-Wshadow" // TODO fix
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic ignored "-Wtype-limits"
#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations" // TODO fix
#pragma GCC diagnostic ignored "-Wunused-parameter" // TODO fix
#endif
#ifdef HAVE_CONFIG_H