#1275 Rearrange compiler warning flags

Larry Doolittle

Before this patch, WARNING_FLAGS applied to both C and C++,
and WARNING_FLAGS_CXX applied to C++ only.
This patch adds a WARNING_FLAGS_CC that applies to C only.
That change should be generally useful; in particular the C
code is almost ready for -Wstrict-prototypes, which does not
apply to C++.

-Wextra (or -W) used to only apply to C++ via WARNING_FLAGS_CXX.
This patch moves it to WARNING_FLAGS, to apply to both C and C++.
Unfortunately, that triggers a ton of warnings.

For now, cover most of the new warnings up by adding
-Wno-unused -Wno-sign-compare -Wno-type-limits
to WARNING_FLAGS_CC. In the long run, I want to change the C coding
style, and take off these disable-warning flags. But those changes
can dribble in as separate commits; this patch is big enough already.

Actually fix a couple missing-field-initializers in libveriuser/veriusertfs.c.

1 Attachments


  • Cary R.
    Cary R.

    • status: open --> closed
  • Cary R.
    Cary R.

    This all looks reasonable. I have applied and pushed this patch. It would be nice to get the -Wno... and more importantly any other warning issues resolved as soon as possible (e.g. I noticed an unused parameter warning in veriusertfs.c and I assume there may be more).