Skip to content

Commit

Permalink
PIO: enabled -Wextra for _my_ code
Browse files Browse the repository at this point in the history
and not for dependencies
  • Loading branch information
MacDada committed May 1, 2023
1 parent 1249842 commit 69087f4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
29 changes: 24 additions & 5 deletions config/common.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ build_flags =

; todo: enable more code quality checkers, just exclude vendor libs somehow…

; This enables some extra warning flags that are not enabled by -Wall.
; https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
; it is OK for my code, shitload of warnings for included libs
; -Wextra

; Warn when a function declaration hides virtual functions from a base clas
; https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html
; it is OK for my code, shitload of warnings for included libs
Expand Down Expand Up @@ -58,3 +53,27 @@ build_flags =
; https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html
; Too much shit from included libs
; -fanalyzer

; List of flags that I want to be applied to _my_ code,
; while I don't want them for the external libraries (dependencies).
;
; Despite the name, it applies also to files in `lib` and `test`.
;
; -> Mostly because the external libs are not / will not be fixed,
; and I don't want them to pollute my build results.
; -> Hence not using `build_flags`.
;
; https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_src_flags.html
; https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html
build_src_flags =
; Enables some extra warning flags that are not enabled by -Wall.
; https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
;
; todo: check that unity warning disappears after PIO upgrade to 6.1.7:
; .pio/build/native/unity_config/unity_config.c:39:37:
; warning: unused parameter 'baudrate' [-Wunused-parameter]
; https://github.com/platformio/platformio-core/pull/4610
;
; todo: move to build_flags when fixed:
; https://github.com/ayushsharma82/WebSerial/pull/63
-Wextra
5 changes: 5 additions & 0 deletions config/native.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ lib_compat_mode = off
build_flags =
${common.build_flags}

; https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_src_flags.html
; https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html
build_src_flags =
${common.build_src_flags}

; https://docs.platformio.org/en/latest/projectconf/section_env_build.html#build-src-filter
build_src_filter = "+<native.cpp>"

Expand Down
5 changes: 5 additions & 0 deletions config/nodemcu.ini
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ build_flags =
; https://git-scm.com/docs/pretty-formats/2.39.0
!echo '-D BUILD_GIT_COMMIT_HASH=\\"'$(git log -1 --format=%%h)'\\"'

; https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_src_flags.html
; https://docs.platformio.org/en/latest/projectconf/sections/env/options/build/build_flags.html
build_src_flags =
${common.build_src_flags}

; https://docs.platformio.org/en/latest/projectconf/section_env_library.html#lib-deps
lib_deps =
${common.lib_deps}
Expand Down

0 comments on commit 69087f4

Please sign in to comment.