lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #55964] CMake's `LWIP_COMPILER_FLAGS` should be split


From: Freddie Chopin
Subject: [lwip-devel] [bug #55964] CMake's `LWIP_COMPILER_FLAGS` should be split for C and C++
Date: Wed, 20 Mar 2019 05:32:03 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0

URL:
  <https://savannah.nongnu.org/bugs/?55964>

                 Summary: CMake's `LWIP_COMPILER_FLAGS` should be split for C
and C++
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: freddie_chopin
            Submitted on: Wed 20 Mar 2019 09:32:02 AM UTC
                Category: Contrib
                Severity: 3 - Normal
              Item Group: Compiler Warning
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

I'm trying out the new CMake build infrastructure and I tried to modify what
is in lwip/contrib/ports/unix/example_app/CMakeLists.txt for my own C++
application. However when using the line below:

target_compile_options(lwip-ppp-test PRIVATE ${LWIP_COMPILER_FLAGS})

I get a build error, because my application is in C++, while the
LWIP_COMPILER_FLAGS is for C only. Here's the exact error:

FAILED: CMakeFiles/lwip-ppp-test.dir/main.cpp.o 
/usr/bin/c++   -I../lwip/src/include -I../lwip/contrib/ports/unix/port/include
-O2 -g   -Wall -pedantic -Werror -Wparentheses -Wsequence-point
-Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual
-Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align
-Wmissing-prototypes -Wnested-externs -Wunreachable-code -Wuninitialized
-Waggregate-return -Wlogical-not-parentheses -Wredundant-decls -Wlogical-op
-Wtrampolines -Wc90-c99-compat -MD -MT CMakeFiles/lwip-ppp-test.dir/main.cpp.o
-MF CMakeFiles/lwip-ppp-test.dir/main.cpp.o.d -o
CMakeFiles/lwip-ppp-test.dir/main.cpp.o -c ../main.cpp
cc1plus: error: command line option ‘-Wc++-compat’ is valid for C/ObjC but
not for C++ [-Werror]
cc1plus: error: command line option ‘-Wold-style-definition’ is valid for
C/ObjC but not for C++ [-Werror]
cc1plus: error: command line option ‘-Wmissing-prototypes’ is valid for
C/ObjC but not for C++ [-Werror]
cc1plus: error: command line option ‘-Wnested-externs’ is valid for C/ObjC
but not for C++ [-Werror]
cc1plus: error: command line option ‘-Wc90-c99-compat’ is valid for C/ObjC
but not for C++ [-Werror]
cc1plus: all warnings being treated as errors
ninja: build stopped: subcommand failed.
The terminal process terminated with exit code: 1

Therefore I propose to split LWIP_COMPILER_FLAGS into LWIP_C_COMPILER_FLAGS
and LWIP_CXX_COMPILER_FLAGS (the names are obviously just a proposal).




    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?55964>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

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