2021-05-13 07:11 PM
Hello
I am a beginner. I am trying to build my project using the minmea library but I got a "timegm" warning.
In the library page says <Some systems lack timegm. On these systems, the recommended course of action is to build with -Dtimegm=mktime which will work correctly as long the system runs in the default UTC timezone.>. I added the -Dtimegm=mktime in this places in my project setting
MCU GCC Compiler >> Miscellaneous >> Add other flags
MCU GCC Linker >> Miscellaneous >> Add other flags
but still I have the messages or warining
How to solve it. I am using STM32CubeIDE 1.4
../Drivers/minmea/Src/minmea.c: In function 'minmea_gettime':
../Drivers/minmea/Src/minmea.c:635:24: warning: implicit declaration of function 'timegm'; did you mean 'time'? [-Wimplicit-function-declaration]
time_t timestamp = timegm(&tm); /* See README.md if your system lacks timegm(). */
^~~~~~
time
12:02:11 Build Finished. 0 errors, 1 warnings. (took 9s.351ms)
Solved! Go to Solution.
2021-05-17 03:42 AM
Hello!
I did some testing on my side. Looks like something might be wrong with the miscellaneous menu option.
If you add timegm=mktime to the preprocessor (MCU GCC Compiler -> Preprocessor) then it works for me. However, adding -D and using the same argument in Miscellaneous doesn't seem to work.
That does seem like a bug. However, I tested it with our internal weekly build and it's fixed there so it will be fixed in the next release.
2021-05-17 03:42 AM
Hello!
I did some testing on my side. Looks like something might be wrong with the miscellaneous menu option.
If you add timegm=mktime to the preprocessor (MCU GCC Compiler -> Preprocessor) then it works for me. However, adding -D and using the same argument in Miscellaneous doesn't seem to work.
That does seem like a bug. However, I tested it with our internal weekly build and it's fixed there so it will be fixed in the next release.
2021-05-17 05:22 PM
Thanks so much.
I don't know why, but it is true... Now I have 0 errors 0 warnings