Skip to content

Require a C99 compiler

Adrian Johnson requested to merge ajohnson/cairo:require-c99 into master

This adds a compile check for C99. See !264 (closed) for further discussion.

I would like the three most commonly used compilers (gcc, clang, msvc) on our supported platforms to just work without needing any CFLAGS to be supplied by the user. Clang and gcc should just work since they have defaulted to at least C99 since 2015. MSVC has only started supporting C991 since Visual Studio 2019 and requires the /std:c11 or /std:c17 flag to be set otherwise it defaults to C89. I've updated the meson.build to set this flag.

We will have to decide:

  1. If we only support VS2019 or later.
  2. Allow older versions. Don't enforce the C99 check on VS. It should still build on earlier versions but if we start using C99 features not shared by C++ the earlier versions will break. Without CI for the earlier versions we won't know if this happens until we get bug reports.

I prefer option 1 but I don't know if VS2019 is too recent for some users.

  1. Strictly speaking, VS2019 only supports C17, C11, and C89, not C99. But I don't think there is anything in C99 that is not in C11 that we care about.

Edited by Adrian Johnson

Merge request reports