Compatibility of C89/C90, C99 and C11

后端 未结 4 1366
梦如初夏
梦如初夏 2021-02-14 03:15

I just read: C Wikipedia entry. As far as I know there are 3 different versions of C that are widely used: C89, C99 and C11. My question concerns the compatibility of source cod

4条回答
  •  無奈伤痛
    2021-02-14 03:52

    The newer versions of C are definitely not strict super-sets of the older versions.

    Generally speaking, this sort of problem only arises when upgrading the compiler or switching compiler vendors. You must plan for a lot of minor touches of the code to deal with this event. A lot of the time, the new compiler will catch issues that were left undiagnosed by the old compiler, in addition to minor incompatibilities that may have occurred by enforcing the newer C standard.

    If it is possible to determine, the best standard to use is the one that the compiler supports the best.

    The C11 wikipedia article has a lengthy description of how it differs from C99.

提交回复
热议问题