All platforms: yes
All compilers: no.
Most are just toy compilers, some are special (tcc)
In terms of which "mainstream" compilers FULLY support a C standard greater
than C89, all of GCC, Clang, and I think Intel's oneAPI DPC++ / C++
Compiler also. But not MSVC.
The default standard for Intel is C89
It doesn't appear that you can set the standard granularly for MSVC,
(except with Linux
But you can force C89 everywhere:
With the caveat:
It isn't possible to specify strict C89
Also, AFAIK, C99 isn't fully implemented by MSVC. My reference for this is
an in the docs for an older MSVC version, which is why I disclaim "AFAIK":
When I write C code I like to ensure it is properly portable. Insofar as
it's possible, the behaviour should be identical no matter the compiler,
target OS, or host OS.
Also I like to compare historic and current innovations, e.g., swapping out
the malloc implementation, and profiling dis/advantaged result.
Finally from an FFI perspective there are advantages in targeting C89, so
that you can guarantee interoperability with the lowest version of whatever
language is calling into C. Additionally the latest version (July 2020
release) of CFFI—a popular one for Python—doesn't support all of C99, but
guarantees support for all of C89.
That is why I target C89.
Charity <https://sydneyscientific.org> | consultancy <https://offscale.io>
| open-source <https://github.com/offscale> | LinkedIn
On Thu, Jan 14, 2021 at 4:02 PM Andreas Schneider <asn(a)cryptomilk.org>
On Tuesday, 12 January 2021 01:56:38 CET Samuel Marks
Cool, I might just do that. Yeah I know C89 is a
bit extreme, but to
proper portability to OpenBSD, FreeBSD, NetBSD,
Windows, Linux, macOS,
illumos, using C89 seems to be the path of least
All of the platforms you mention here support C99 ...