| | 1073 | |
| | 1074 | # Some comments on strict warning options. |
| | 1075 | # These were added to reduce warnings: |
| | 1076 | # -Wno-missing-field-initializers -- We want to allow a struct to be |
| | 1077 | # initialized to zero using "struct x y = {0};" and not require |
| | 1078 | # each field to be initialized individually. |
| | 1079 | # -Wno-type-limits -- There are places where we compare an unsigned to |
| | 1080 | # a constant that happens to be zero e.g., if x is unsigned and |
| | 1081 | # MIN_VAL is zero, we'd like to do "MPIU_Assert(x >= MIN_VAL);". |
| | 1082 | # Note this option is not supported by gcc 4.2. |
| | 1083 | # -Wno-unused-parameter -- For portability, some parameters go unused |
| | 1084 | # when we have different implementations of functions for |
| | 1085 | # different platforms |
| | 1086 | # -Wno-unused-label -- We add fn_exit: and fn_fail: on all functions, |
| | 1087 | # but fn_fail may not be used if the function doesn't return an |
| | 1088 | # error. |
| | 1089 | # These were removed to reduce warnings: |
| | 1090 | # -Wcast-qual -- Sometimes we need to cast "volatile char*" to |
| | 1091 | # "char*", e.g., for memcpy. |
| | 1092 | # -Wpadded -- We catch struct padding with asserts when we need to |
| | 1093 | # -Wredundant-decls -- Having redundant declarations is benign and the |
| | 1094 | # code already has some. |
| | 1095 | |
| | 1096 | pac_common_strict_flags="-O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wstrict-prototypes -Wmissing-prototypes -DGCC_WALL -Wno-unused-parameter -Wno-unused-label -Wshadow -Wmissing-declarations -Wno-long-long -Wfloat-equal -Wdeclaration-after-statement -Wundef -Wno-endif-labels -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Wsign-compare -Waggregate-return -Wold-style-definition -Wmissing-noreturn -Wmissing-format-attribute -Wno-multichar -Wno-deprecated-declarations -Wpacked -Wnested-externs -Winline -Winvalid-pch -Wno-pointer-sign -Wvariadic-macros -std=c89" |