Arduino IDE fails to collect function headers

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
Post Reply
Phono
Posts: 68
Joined: Thu Mar 19, 2020 9:32 am

Arduino IDE fails to collect function headers

Post by Phono »

It has been several times I experience this issue, over several years.
I am using the Arduino IDE 1.8.12 with the STM32Duino package installed.
I have a large sketch (2285 lines after merging). There are 11 different identifiers that switch blocks of code using many nested #ifdef...#else...#endif structures, providing for various options.
I sometimes have compile errors like

Code: Select all

'TacheEmissionSerie' was not declared in this scope; did you mean 'hTacheEmissionSerie'?
When I look at the global file generated by the IDE, I notice that the IDE failed to collect the header of one or more functions to put them at the top of the code as it does normally.
I also experience unexpected execution results, as if some lines of code were missing or displaced.
This only occurs when the #ifdef...#endif structures are many.
Is this flaw known? Could the IDE development team take this issue into account?
Last edited by Phono on Thu May 07, 2020 11:56 am, edited 1 time in total.
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Arduino IDE fails to collect function headers

Post by stevestrong »

I haven't ever used Arduino IDE for code editing, only for compile/build test bench.

Usually I do not use code with many (more than 2..5) #ifdefs, so I have not observed such a behavior.

But with many #ifdefs you can yourself introduce some errors into the sketch.
If it gives you some alternative, it means it still does parse the headers.
stas2z
Posts: 131
Joined: Mon Feb 24, 2020 8:17 pm
Answers: 8

Re: Arduino IDE fails to collect function headers

Post by stas2z »

just declare your function prototypes by yourself before it used in your code
I think it's a bad style to let ide create declarations for you even if it can
Phono
Posts: 68
Joined: Thu Mar 19, 2020 9:32 am

Re: Arduino IDE fails to collect function headers

Post by Phono »

I eventually found what was wrong.
A statement did end with a ":" instead of a ";".
This fooled the IDE mechanism, but instead of flagging the mistake, it behaved badly.
After changing this character to a ";", the IDE worked well again.
It is always difficult to find a mistake when it is not detected as such by the IDE which just went astray. It is by chance I found it.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Arduino IDE fails to collect function headers

Post by fpiSTM »

I never met this kind of issue and I already build sketch bigger than yours.
Probably you got an issue in your sketch which prevents to parse it properly.
Anyway I'm agree with stas2z and I doesn't like the way Arduino "process" all input files.
Post Reply

Return to “IDE's”