- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.1k
 
Closed
Description
The include paths are set using:
    target_include_directories(pico_stdlib_headers INTERFACE include)
(e.g. in src/common/pico_stdlib/CMakeLists.txt)
As they're not marked as SYSTEM,  enabling warnings  (e.g. -Wall) will erroneously be tagged in the system headers.
pico-sdk/src/rp2040/hardware_regs/include/hardware/regs/addressmap.h:56:20: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
   56 | #define TIMER_BASE 0x40054000
for example. If the headers are tagged SYSTEM then CMake uses -Isystem or equivalent which tells the compiler to suppress warnings coming from those includes.
A potential fix is:
$ git grep -l target_include_directories | xargs perl -pi -e 's/target_include_directories(.*)INTERFACE/target_include_directories$1SYSTEM INTERFACE/'