cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavior of IDE (modifies my code)

PG.1
Associate III

Hello!

I have a weird problem with IDE.

I have defined a structure which aims at initializing a menu item.

This structure contains a few items including an opcode to be sent to an FPGA.

The name of the structure is panel_config_item.

Then I have declared a list of these items like this:

panel_config_item PCIGlobalList[] = { // PCI stands for panel config item

// From here, a list of actual structure initializations between {}

{config 1 parameter list},

{config 2 parameter list},

[...]

{last config parameter list}

};

When I compile, the space between panel_config_item and PCIGlobalList gets removed

and the compiler tells me error: panel_config_itemPCIGlobalList does not name a type.

Well, that's true, but does any one have a clue about the reason why the space gets

removed?

Thanks!

7 REPLIES 7
Rim LANDOLSI
ST Employee

Hello @Community member​  and welcome to the community,

I have tried to reproduce this issue on CubeIDE version 1.12.1. In fact, I don't have any compile error telling that the space between the structure name and the declared list of its items gets removed.

In order to well understand the problem, could you please provide the used CubeIDE version for this project, also, it would be more helpful to share the full project.

thanks,

Rim.

PG.1
Associate III

Hello!

Version 1.12.0, Ubuntu.

I wasn't aware of 1.12.1. I'm going to try, just in case.

But I have been using structures and lists of structures in the past, without any problem.

P.

PG.1
Associate III

Hello!

Some more info.

I have installed 1.12.1, and same result.

When I try to save a file (ctrl-S), the little star on top, that says that the file was edited stays for a few

seconds, and then the space I have added disappears and my file is un-edited (the space has disappeared).

If I add a new line instead of a space, same effect.

If I add some other text (for example an include file), then the editor works normally.

I verified the access rights for that file and they are rw-rw-r (664) as all other files. Anyway the

IDE can write in the file because I could include a file and save.

Even more surprising:

If I edit the file externally with another editor, gedit or anything else and save it,

then the program compiles and runs fine.

And finally, I tried to declare another list of config items somewhere else

and in this case it also compiles fine (although the new list is not used).

Pavel A.
Evangelist III

Very strange. A miracle.

Does the file have both CRLF and LF ended lines? Then convert all line ends to one format.

Rim LANDOLSI
ST Employee

Hello @Community member​ ,

I have tested with Ubuntu and Windows and it works fine from my side. Could you please share the project for further analyze this issue.

alister
Lead

You've an eclipse builder or pre-build step that's modifying the file?

PG.1
Associate III

Hello!

@Rim: no, sorry, I cannot share the project.

@alister: no prebuild that I'm aware of. Beside this, if there was a prebuild, it would probably affect other files. I have probably 200 files now.

Anyway, I have rebuild the file step by step, cleaned the code, and now it works. I don't know what happened, sorry for the mess.