-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Potentitally uninitialised MlmeConfirm_Queue_t when building master/v4.7.0 #1352
Comments
I have tried to run the build using GCC with Maybe the GCC version that I am using understands that in the mentioned case the variable is ensured to always be initialized as the initialization and variable usage only happens if Variable initialization: LoRaMac-node/src/mac/LoRaMacConfirmQueue.c Lines 292 to 302 in e533790
Variable usage: LoRaMac-node/src/mac/LoRaMacConfirmQueue.c Lines 307 to 311 in e533790
For info the GCC version that I am currently using is:
|
I have tried as well to compile with latest available GCC version and no warning is generated when using
Could you please indicate which compiler version you are using? |
Running on MacOS 12.6
On closer inspection I realised that this was only warning on a release build, where -O3 is used for max optimisation. -O2 also produces the same warning, and I believe that higher optimisations removes default initialisation and therefore the lack of specific initialisation on LoRaMacConfirmQueue.c:284 means that The following mutes the warning:
You might have a recommendation about maximum optimisation levels, but I've been compiling with -O3 for some time, and this just cropped up on the master branch (HEAD @ e533790). I just checked the blame history for the code and neither the definition or the usage appears to have changed in several years so I'm not sure why it would have started bleating about it now. |
Usually we only compile with In order to suppress the warning when using |
I had reason to grab the master branch to check if some unexpected behaviour was manifesting in later build (I was building against 4.4.5 for an existing project).
I'm not building the sample projects, or using the included CMakeLists.txt, but have created my own CMakeLists.txt to pull in the LoRaMac sources.
I'm building for STM32L082 MCU on a custom board, closely related to the B-L072Z-LRWAN1 reference board, and using gcc-arm-none-eabi compiler. I'm getting the following error which seems genuine, and maybe this is a warning that you are suppressing in your builds.
I appreciate that master is not a release, but as work seems to be complete on 4.7.0 milestone thought you might like to check this before release.
The text was updated successfully, but these errors were encountered: