>> I'm trying to port compcert to openbsd. Here's a first patch to allow
>> jot to be compiled with compcert.
> Wouldn't it be better to check for __STDC_VERSION__ >= 199901L rather than a
> list of compilers? (I don't have a source tree close by which is why I don't
> have a patch.)
Supporting _Bool and claiming support for C99 are independent of each
other. For example gcc supports _Bool in c89 mode (see example below).
Compcert relies on the gnu c preprocessor so its behaviour is the same
as gcc's.
I don't think testing for __STDC_VERSION__ would work here.
# ------ gcc
-----------------------------------------------------------------------------------------------------
[~] cat testcase.c
#include <stdio.h>
int main(int argc, char* argv[]) {
_Bool a = 1;
if (a) {
printf("here\n");
}
}
[~] gcc -std=c89 testcase.c
[~] ./a.out
here