https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82695
Bug ID: 82695
Summary: gnu gcc (4.8 - 7.1) cannot parse some system headers
in macOS (10.12)
Product: gcc
Version: 4.8.5
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: drikosev at gmail dot com
Target Milestone: ---
Hi,
gnu gcc cannot parse some system headers in macOS (10.12)
. One bug is this:
$ cat framework-1.c
#include <Carbon/Carbon.h>
int main(){
return 0;
}
$ gcc framework-1.c
In file included from
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h:18:0,
from
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h:9,
from
/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:11,
from
/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:35,
from
/System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:24,
from framework-1.c:1:
/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h:53:1:
error:initializer element is not constant
static const CGFontIndex kCGGlyphMax = kCGFontIndexMax;
The error is issued in gcc/c/c-typeck.c by the following fragment (7 lines):
else if (require_constant
&& !initializer_constant_valid_p (inside_init,
TREE_TYPE (inside_init)))
{
error_init ("initializer element is not constant");
inside_init = error_mark_node;
}
Is there a workaround that would allow gcc to accept such an initialisation?
Ev. Drikos