Closed carsanbu closed 2 years ago
Hi @carsanbu and thank you for your feedback. The first thing that comes to mind (to me) is that you can at least locally explicitely tell the compiler you don't want to use variables like so :
void my_function(int a, int b, int c)
{
(void) a;
(void) b;
(void) c;
// more code
}
Casting a variable to void is essentially seen as a no-op by the compiler and is ignored at the execution (no instructions are generated in assembly and machine code). You can check for the example depicted here
In case you really want to use those flags directly within the CMakeLists.txt, I've done several things in order to support warnings but warnings with special value like -Wno-error=
Normally, flags that are unknown to AtmelStudio should be listed under the "other flags" node, but I need to check if that stands true, there might be a hole in the implementation regarding this aspect (!). I'll keep you posted when I have some time to spend on this !
Starting some developments on it to fix this behavior. This was caused by the extra warning flags not being deduced (I forgot some instructions in the codebase). Linking the branch bug/42/repairing_extra_warning_flags_deduction. With the associated PR
As depicted in the PR modified source files, the compiler abstraction / toolchain xml representation in AtmelStudio7 does not support "exotic" flags such as the ones you've used. When I say exotic, I'm only referring to how AtmelStudio7 GUI was developed regarding flag support. So I forgot to properly filter out the extra flags from the one supported by the toolchain, that was an easy fix as all the code was already there.
Hi @carsanbu , I've implemented some fixes for this issue and I have some build artifacts that you may use for testing purposes. Could you check with the build located within this run ? You can go to the bottom of the page, and download the CMakeAS7-BuildArtifacts-winx64. It's basically the locally package version of cmake and as cmake is monolithic, you should be able to use it from the decompressed .zip archive.
You can also have a look at the PR itself, the changes were ported in the testing section.
If your manual testing validates the build, I'll merge the PR and close the ticket ; then I'll repackage the whole thing and reupload the new files as latest artifacts. [EDIT] : I discovered some issues (noticeably a small regression, which removes the include directories... #48 ) so it's not ready yet 😓 I'll post an update when the thing is back to functional again.
Hi @carsanbu , your problem is now fixed and integrated into master branch. You can grab the latest release 3.20.2-bugfix1 and try it for yourself. I've implemented a basic test project that mimics the kinds of inputs you might have in your project, more details can be found here : AVR8_C_fake_app).
It is handled correctly on my system and flags are parsed correctly ; unknown flags such as the ones you used are reported as "miscellaneous warning flags".
For now, this is the only integration test I'm running and it's very manual, I'm planning on adding the CMakeAS7-TestProjects repo as a submodule in order to automatically trigger them within the CI/CD pipelines. I also updated the few tests I have at hands for now that check that sort of things : testCmAvrGccCompiler.cpp.
Thanks for reporting this issue 👍
First at all, I am very grateful to this project, thank you @bebenlebricolo! I am using the cmake with this toolchain. I want to suppress some warnings that are treated as errors, this is my CMakeLists.txt:
The problem is the warning are not passed on to the atmel studio project and the build ever break with unused parameters.