__DATE__ macro expansion incorrect in editor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-06 6:48 AM - last edited on ‎2025-01-22 8: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.
- Month name is in Dutch
- Month name is in lower case
- Day of month is left-padded with 0 instead of a space
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
- Labels:
-
Bug-report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-07 9: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-07 12:35 PM - edited ‎2024-05-08 5: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.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-08 2: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-08 5:02 AM - edited ‎2024-05-08 5: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.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-08 6: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-22 7: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).
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-22 7:25 AM
Hello @unsigned_char_array
I will keep you updated when it is fixed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-22 8: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?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-22 8: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.
