Hello.
I see this commit message http://osdir.com/ml/svn-commits-list/2009-08/msg06668.html in gobject-introspection concirning Sun cc. It seems that nobody cared about Sun cc support in gobject-introspection enough to test it a bit.
This results that gobject-introspection can't parse cc -E output.

Try to build any tool: you'll get a lot of
usr/include/glib-2.0/gio/gresolver.h:20: syntax error, unexpected INTEGER in '# 20' at '20' /usr/include/glib-2.0/gio/gresolver.h:157: syntax error, unexpected INTEGER in '# 163' at '163' /usr/include/glib-2.0/gio/gseekable.h:22: syntax error, unexpected INTEGER in '# 22' at '22' /usr/include/glib-2.0/gio/gseekable.h:55: syntax error, unexpected INTEGER in '# 57' at '57' /usr/include/glib-2.0/gio/gsettings.h:21: syntax error, unexpected INTEGER in '# 21' at '21' /usr/include/glib-2.0/gio/gsettings.h:158: syntax error, unexpected INTEGER in '# 166' at '166' /usr/include/glib-2.0/gio/gsettings.h:174: syntax error, unexpected INTEGER in '# 181' at '181' /usr/include/glib-2.0/gio/gsettings.h:198: syntax error, unexpected INTEGER in '# 204' at '204'

and similar errors.
Now let's fix this a bit (either use gcc instead of cc) or the following patch

--- gobject-introspection-0.9.12/giscanner/scannerlexer.l.~1~ 2010-10-04 19:58:05.000000000 +0400 +++ gobject-introspection-0.9.12/giscanner/scannerlexer.l 2014-05-16 17:27:32.766096864 +0400
@@ -81,6 +82,7 @@
 "#pragma ".*"\n"                       { /* Ignore pragma. */ }

 "# "[0-9]+" ".*"\n"                    { process_linemarks(scanner); }
+"# "[0-9]+"\n"                         { /*ignore cc linemark*/ }
 "#"                                    { }
 "{"                                    { return '{'; }
 "<%"                                   { return '{'; }
@@ -139,6 +141,7 @@
"__attribute" { if (!parse_ignored_macro()) REJECT; }
 "__const"                               { return CONST; }
 "__extension__"                         { return EXTENSION; }
+"__inline__"                            { return INLINE; }
 "__inline"                             { return INLINE; }
"__nonnull" { if (!parse_ignored_macro()) REJECT; }
 "__signed__"                           { return SIGNED; }


this patch allows g-ir-scanner to ignore
# SomeNumber
lines, generated by cc.
(cc -E generates line numbering information in form:
# 1 "file path"
# 26
# 29
# 1 "file 2 path"
...

gcc -E generates it as
# 1 "file path" ...
# 26 "file path" ...
# 29 "file path" ...
# 1 "file 2 path" ...
...)

After this fix:

we got the following error building gtk+

"Namespace conflict for 'Display'..."

Besides this we get a lot of
/usr/include/stddef.h:32: syntax error, unexpected identifier in '#ident "%Z%%M% %I% %E% SMI"' at 'ident'
...

The same "Namespace conflict for 'Display'..." can be seen when we use gcc to build gtk+ (and force gobject-introspection also use gcc)...

Am I doing something wrong or has nobody never seen this???
--
Best regards,
Alexander Pyhalov,
system administrator of Computer Center of Southern Federal University

_______________________________________________
oi-dev mailing list
[email protected]
http://openindiana.org/mailman/listinfo/oi-dev

Reply via email to