cancel
Showing results for 
Search instead for 
Did you mean: 

ST, don't use /** **/ for one line comments

LMI2
Lead
Posted on October 26, 2017 at 22:43

Because IDE does not like nested comments. I am commenting several lines of example code but some idiot has put every other line an one line a /* */ comment.

Fix that software please.

Not like this:

 /* Insert a delay of display */
 HAL_Delay(2);
 }
 /* Clear the Background Layer */
 BSP_LCD_Clear(LCD_COLOR_BLACK);�?�?�?�?�?�?

//

3 REPLIES 3
S.Ma
Principal
Posted on October 27, 2017 at 06:55

Maybe call this a MISRA consequence more than ST's for compatibility with all users out there

(for industrial or automotive, sometime the tools are kept the same for 10 years without upgrades)

https://stackoverflow.com/questions/9538589/rationale-for-comment-rules-in-misra

 

My workaround for this is 

#if 0

junked source code

#endif

AVI-crak
Senior
Posted on October 27, 2017 at 09:11

/ * Used for compatibility with dinosaurs from 1998 * /

Modern IDs often get malfunctioned in the code syntax highlighting module - due to stack overflow. There is a technical limit of 65k lines - below which the plug-in begins to suffer from amnesia. When the amnesia boundary falls / * neatly between several lines of comments * / - the synchronization is violated and the user sees a frank porridge. For example, the incorrect operation of conditional operators #if.

Everything was fine while the projects were thin.

Using // for comment, and /// for an important comment - solves the problem of amnesia.
Posted on October 27, 2017 at 15:59

 ,

 ,

Interesting

I wonder why Keil Ide is so upset of this when this problem has been there for years.

I have to try this

♯ if 0

junked source code

♯ endif

Using // for comment, and /// for an important comment - solves the problem of amnesia.

Yes but when the one with dementia is ST, what can you do.

LM