2024-05-06 06:48 AM - last edited on 2025-01-22 08:27 AM by Tesla DeLorean
Gcc and Visual Studio correctly compile today's date __DATE__ to "May 6 2024". However STM32CubeIDE editor expands the macro incorrectly if I hover the cursor over it.
2024-05-07 09:44 AM
Hello,
I didn't reproduce the issue with CubeIDE 1.15.1 (today May 7th 2024):
If you could share your sample project so I can reproduce it from my side. Also indicate the CubeIDE version you're using.
2024-05-07 12:35 PM - edited 2024-05-08 05:02 AM
I use STM32CubeIDE 1.11.2 at the moment. My system language is Dutch. I can check if the same problem persists with a newer version.
You did manage to reproduce part of the issue. The day of the month should not be left-padded with a zero, but with a space. If you compile GCC uses the proper format. It's only the preview in the editor that is incorrect.
2024-05-08 02:23 AM
Hello,
This is what I get with CubeIDE 1.15.1:
Day of month is left padded with a space.
Ok then it's only the display popup is different but the string contains the correct char: a space. Do you see an issue in that behavior?
2024-05-08 05:02 AM - edited 2024-05-08 05:04 AM
Issues are only in macro expansion in editor (popup as you call it), not in binary.
I tested with a freshly generated project and an old project and in version 1.15.1 as well. Issue is not project specific.
In STM32CubeIDE 1.15.1 I get the same result as you. So only the left-padding issue, not the language or capitalization. And in 1.11.2 and 1.10.1 I see all three issues. So it seems the issue got half-fixed at some point.
2024-05-08 06:42 AM
Ok.
I'm not seeing a blocking issue in that since it's only a display and doesn't impact the cross-compilation result meanwhile I'm raising the internal ticket 180951 to fix this minor issue. This ticket is not accessible by community members.
I will get back to you for any feedback: to fix or not to fix.
2025-01-22 07:05 AM
Problem with zero-padding still present in STM32CubeIDE V1.17.0.
Tested in windows sandbox to allow changing of system date (my work PC doesn't allow me to change system date).
2025-01-22 07:25 AM
Hello @unsigned_char_array
I will keep you updated when it is fixed.
2025-01-22 08:31 AM
Strikes me as a intrinsic MACRO furnished by STM32CudeIDE based on the date stamp of the file, rather than something GCC or VS is responsible for at this point.
The criticality of this is probably deemed quite low as it's more of a syntax-check / visual cue rather than something that materially impacts the code build. You have some compile time dependency on this?
2025-01-22 08:49 AM
The __DATE__ macro is specified by the C language standard:
CubeIDE is not abiding by that standard.
A very minor point, IMO - but it is wrong.