OK... the language used with Arduino is based on C++. Some questions:
Which C++? C++11? An earlier version?
The language reference page doesn't include very much. Does a programmer for Arduino have access to the full C++ language? (The page on integer constants doesn't mention the option of a suffix to indicate unsigned and/or long, nor does the page on floating point constants say anything about using the "f" suffix for float (rather than double) constants. There's nothing on the reference page about declaring one's own classes.) I presume that we don't get to write main() but instead link against a stock main that does something like
startup();
for (; ; ) {
loop();
}
but can one declare one's own classes? Do we have access to templates?
Finally, is there a specification of just what the preprocessing does to try to "help" the programmer (e.g. the bit referred to earlier in the thread about what sounds like trying to automatically generate prototypes for forward references to functions), and is there some way to turn it off? C++ is already insanely convoluted, and I'm not sure I'll be helped by something fiddling with the source code in ways I have yet to find a description of.
I think it also copies the set of files that it thinks constitutes your complete solution into a temporary directory before it compiles them. The algorithm for selecting the necessary files is imperfect. (This also means that the usual guidelines for using #include file references don't work.)
Scan your main sketch (the .ino file) for #include directives.
If they refer to a known "library" (ie. one that it detected when the IDE started) then copy the library (the entire folder I think) to a temporary location.
Copy the main sketch to this temporary location and compile from there, with the "include path" set to point to this temporary directory.
Hence in addition to where you might normally put your #include directives they also have to appear in the main sketch to trigger this behaviour.
The advantage of this is that your "sketch" folder is not cluttered with object, hex, elf files etc. Also it is possible to compile and test without even saving your sketch to disk (the copy of your main sketch is from the in-memory copy).
You can write your own main, then you don't need setup() and loop(). Just remember to call init() before you use certain Arduino specific features like delay() or millis().
The IDE adding stuff is the price we pay for ease of use. Atmel studio 6 supports gcc 4.6.x, might even be 4.7.x now; and has c++11 support.
If multiple declarations are causing errors ( declared in header, defined in sketch ), inside the sketch just wrap you function declarations in #if blocks that never get entered, then the IDE will see them, but the compiler won't.
Freakishly good memory. (And a bit of Google-sgil.)
Men are vexed by women's phenomenal memory of past transgressions. Despite my good memory, I am too. I guess that means my wife has a super freak memory.
[quote author=Coding Badly link=topic=160239.msg1200454#msg1200454 date=1365930503]I guess that means my wife has a super freak memory.
How is it on topics other than your transgressions?[/quote]
Her memory is generally super freaky. And, she's strong on technical matters. When we discuss programming or circuits, she can recall long ago but very relevant conversations. I've said it before and I'll say it again, I'm a very fortunate man (as long as I don't get on her bad side :D).