Chris Hills said:
Firstly what are the compilers and targets?
Due to the lack of serious take up of the current C99 standard and
many compiler having compiler and target extensions (also domain
extensions) it is better to start with the tools than the standard.
You have asked a practical not theoretical question.
But the C90 standard, even though it's "officially" obsolete, is
almost universally supported. If you write C90-conforming code with
no extensions, and manage to avoid exceeding implementation-defined
limits, you can be reasonably confident that your code will compile
and run with any existing compiler invoked with appropriate options.
For maximal portability, you can stick to the intersection of C90 and
C99. This means avoiding implicit int and implicit function
declarations, avoiding C99 keywords, and probably a few other things.
If you really need your code to be compatible with C++ as well, the
main things to worry about are avoiding C++ keywords, dealing with the
lack of implicit conversions to and from void*, and probably some
other things I haven't thought of.
But there are other subtle differences between C and C++, and if
you're going to write code that compiles as both, you'll *always* have
to worry about the possibility of running into one of them.
As I mentioned elsethread, you should consider just programming in C.
I've never heard of a platform that has a C++ implementation but not a
C implementation.