??? 03/23/10 16:59 Read: times |
#174437 - How many compler brands/versions to test for? Responding to: ???'s previous message |
Having #ifdef for different compilers will not make the code less compiler specific. It obviously makes it more compiler specific.
Another thing here is that compiler vendor X may decide to change the memory layout of their data structures between versions of the compiler, in which case the source code will recognize the compiler but fail to notice that the manually corrected code isn't correct anymore. Another thing - exactly how readable is code with a lot of #ifdef sprinkled? And how much time do you save by testing your #ifdef section and documenting it, compared to just writing portable code? If a new programmer gets involved in the project - do you think the new programmer will be more comfortable trying to read through your documentation about special cases, or instead seeing traditional portable code? |