Open coslu opened 4 years ago
The _Alignas
implementation is incomplete (only parser, but doesn't change alignment), which causes goblint
to fail to parse OCaml 5.0 domain_state.h
with a static assertion failure (array length negative).
A workaround is to use the following, which seems to work (the GCC aligned attribute seems to have the desired effect and change alignment):
--set 'pre.cppflags[+]' -D'_Alignas(x)=__attribute__((__aligned__(x)))'
@edwintorok thanks for the information and the workaround. I'll try to fix this issue in CIL (shouldn't be too difficult if the equivalent GCC attribute works), but it'll likely be only after the holidays.
Thanks, no rush I can use the workaround meanwhile.
CIL lacks support for various additions to the C language that come with the C11 specification. It would be beneficial to identify and implement features to improve CIL's support for C11.
To check/implement from wiki/C11:
_Alignas
specifier,_Alignof
operator,aligned_alloc
function,<stdalign.h>
header file)._Noreturn
function specifier and the<stdnoreturn.h>
header file._Generic
keyword. For example, the following macrocbrt(x)
translates tocbrtl(x)
,cbrt(x)
orcbrtf(x)
depending on the type of x:_Thread_local
storage-class specifier,<threads.h>
header including thread creation/management functions, mutex, condition variable and thread-specific storage functionality, as well as<stdatomic.h>
for atomic operations supporting the C11 memory model).char16_t
andchar32_t
types for storing UTF-16/UTF-32 encoded data, including conversion functions in<uchar.h>
and the correspondingu
andU
string literal prefixes, as well as theu8
prefix for UTF-8 encoded literals).struct T { int tag; union { float x; int n; }; };
.#if
and#error
, when types are understood by the translator."…x"
suffix) for fopen. This behaves likeO_CREAT|O_EXCL
in POSIX, which is commonly used for lock files.quick_exit
function as a third way to terminate a program, intended to do at least minimal deinitialization if termination with exit fails.timespec_get
function and corresponding structure in<time.h>
with a degree of POSIX compatibility.real + imaginary*I
might not yield the expected value ifimaginary
is infinite or NaN).