autoconf-archive-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Suggestions for "ax_compiler_flags_cxxflags"


From: Xin Liu
Subject: Suggestions for "ax_compiler_flags_cxxflags"
Date: Thu, 5 Nov 2020 16:10:18 +0800

Hi,
  we are currently using this macro to generate CXX_FLAGS for compiling.
  Something found during the work..

1. Many flags inside the macro is enabled already by
     -Wall -Wextra and list it inside the MACRO is redundant

e.g
``` -Wreturn-type
 -Warray-bounds
 -Wunused-but-set-variable
 -Wstrict-aliasing
 -Winit-self
-Warray-bounds
-Wsign-compare
-Wunused-but-set-variabl
-Warray-bounds
...
```
-Wformat=2  equivalent -Wformat-nonliteral

2.  The CXXFLAGS disabled some default WARNING options, e.g
-Wno-unused-parameter -Wno-missing-field-initializers 
-Wno-overloaded-virtual 
-fno-strict-aliasing

 Which should not be needed. if we want to disable it we could append it apparently.

3.  The Warning FLAG ' -Wswitch-enum ' caused a lot trouble when we use google protobuf

As protobuf will always generate
 protobuf::Type_INT_MAX_SENTINEL_DO_NOT_USE_:
 protobuf::Type_INT_MIN_SENTINEL_DO_NOT_USE_:

And warning will be reported because this 2 enums are not specified in SWITCH/CASE.

Is that possible for you to remove those flags(1.2.3) from this macro? thanks in advance.


```
            -Wall dnl
            -Wextra dnl
            -Wundef dnl
            -Wwrite-strings dnl
            -Wpointer-arith dnl
            -Wmissing-declarations dnl
            -Wredundant-decls dnl
            -Wno-unused-parameter dnl
            -Wno-missing-field-initializers dnl
            -Wformat=2 dnl
            -Wcast-align dnl
            -Wformat-nonliteral dnl
            -Wformat-security dnl
            -Wsign-compare dnl
            -Wstrict-aliasing dnl
            -Wshadow dnl
            -Winline dnl
            -Wpacked dnl
            -Wmissing-format-attribute dnl
            -Wmissing-noreturn dnl
            -Winit-self dnl
            -Wredundant-decls dnl
            -Wmissing-include-dirs dnl
            -Wunused-but-set-variable dnl
            -Warray-bounds dnl
            -Wreturn-type dnl
            -Wno-overloaded-virtual dnl
            -Wswitch-enum dnl
            -Wswitch-default dnl
  ```

--

Best Regards,
Liu Xin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]