I had envisaged one of these in the project preferences
TESTING=HOSTTESTING=TARGETTESTINGnot defined at all
My problem is with the latter.
It seems that instead of
#if TESTING==HOST
#error "HOST defined" // add temporarilly for testing porpoises
#endif
I need to code
#ifdef TESTING
#if TESTING==HOST
#error "HOST defined" // add temporarilly for testing porpoises
#endif
#endif
I am convinced that this is not-standard behaviour, since if TESTING is not defined then it certainly doesn’t equal HOST, and I do not need that extra #ifdef TESTING with the GCC compiler.
However, when I use the Atmel AVR Studio (which I think is based on MS Visual Studio), it is necessary to add that initial #ifdef TESTING in a few dozen places 🙁
It looks like I have no choice, but I just wondered if any C standard acually requires this.
If
TESTINGis not defined, thenit is equivalent to:
From the C Standard: