Closed icmccorm closed 1 year ago
I guess GCC is doing more constant-folding to evaluate the condition than CIL does. Looking at the preprocessed source, where GIT_CONTAINER_OF
, etc are expanded should reveal what the conditional expression is.
The corresponding expression appears to be fairly complex.
# define GIT_CONTAINER_OF(ptr, type, member) \
__builtin_choose_expr( \
__builtin_offsetof(type, member) == 0 && \
__builtin_types_compatible_p(__typeof__(&((type *) 0)->member), __typeof__(ptr)), \
((type *) (ptr)), \
(void)0)
We don't have the resources to investigate this further at the moment and make sure CIL's constant folding is up-to-date with recent versions of GCC, and such issues can usually be avoided with a little editing of the input files.
I'm closing this for now, though we would of course welcome patches to fix issues such as this one if someone has the resources to dive deeper here.
When compiling libgit2 using cilly, I've encountered the following error:
This error does not occur when using only gcc. This is occurring on Ubuntu 22.04.1 LTS with gcc 11.2.