Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build_src_flags impacts not only src_dir but also dependencies? #4667

Closed
1 task done
MacDada opened this issue Jun 18, 2023 · 2 comments
Closed
1 task done

build_src_flags impacts not only src_dir but also dependencies? #4667

MacDada opened this issue Jun 18, 2023 · 2 comments

Comments

@MacDada
Copy link
Contributor

MacDada commented Jun 18, 2023

  • PlatformIO Core.

PlatformIO Version (platformio --version): PlatformIO Core, version 6.1.7

Description of problem

According to the docs build_src_flags "will be applied only for the project source files in the src_dir directory".

The problem is, it also applies to dependencies (external libraries) while… running tests :P

Steps to Reproduce

  1. platform: native
  2. lib_deps = fabiobatsilva/ArduinoFake@0.3.1
  3. build_src_flags = -Wpedantic
  4. pio test

Actual Results

In file included from test/native/DnAppLogger/Decorator/test_SequenceLogger/SequenceLoggerTest.cpp:8:
In file included from lib/DnAppCommon/src/DnApp/Common/Strings.h:3:
In file included from arduino/cstdarg/cstdarg:13:
In file included from .pio/libdeps/native_arduino/ArduinoFake/src/Arduino.h:1:
In file included from .pio/libdeps/native_arduino/ArduinoFake/src/ArduinoFake.h:11:
.pio/libdeps/native_arduino/ArduinoFake/src/fakeit/fakeit.hpp:5749:27: warning: zero size arrays are an extension [-Wzero-length-array]
        char instanceArea[SIZE ? SIZE : 0];
                          ^~~~~~~~~~~~~~~
.pio/libdeps/native_arduino/ArduinoFake/src/fakeit/fakeit.hpp:6027:36: note: in instantiation of template class 'fakeit::FakeObject<FunctionFake>' requested here
        static_assert(sizeof(C) == sizeof(FakeObject<C, baseclasses...>), "This is a problem");
                                   ^
.pio/libdeps/native_arduino/ArduinoFake/src/fakeit/fakeit.hpp:7935:41: note: in instantiation of template class 'fakeit::DynamicProxy<FunctionFake>' requested here
        DynamicProxy<C, baseclasses...> _proxy;
                                        ^

Expected Results

Clean test results, without the issues from external ArduinoFake library.

If I remove build_src_flags = -Wpedantic, the issues do not appear, so clearly build_src_flags impacts code outside of the src dir…


  • a.) There is a bug in platformio core –> build_src_flags should not impact code from external libraries.
  • b.) There is a bug in platformio docs -> it should be better explained what's actually going on.
MacDada added a commit to MacDada/DnWiFiDoorLock that referenced this issue Jun 18, 2023
* not enabling for `native_arduino` -> as I'm getting lots of shit from `ArduinoFake`
* marking framework packages as "system" to disable checking for them -> as they also throw a lot of shit
* I have a little amount of shit in my code -> to be fixed

platformio/platformio-core#4667
@ivankravets
Copy link
Member

Could you try to run in verbose mode -vvv? Do you see -Wpedantic for dependencies?

Please take a look at the chain, flag was applied for SequenceLoggerTest.cpp:8: where later that file included nested headers...

@ivankravets
Copy link
Member

Please reopen if you still need help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants