Search code examples
ccompatibilityansi-c

C - code compatibility


How to make sure, that my code is compatible with every gcc compiler set to the most strict level? Is there any tester tool or do I need to test it manually somehow? Thanks


Solution

  • Every gcc compiler is easy, just use an old one and it will compile for sure with the newer ones.

    If you want it to compile with any compiler it's a bit more hard. As suggested you might use the -ansi switch to disable gcc extensions.