After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 639749 - g-ir-scanner cannot handle complex.h
g-ir-scanner cannot handle complex.h
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: g-ir-scanner
2.26.x
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-01-17 14:11 UTC by Yeti
Modified: 2018-01-25 16:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
g-ir-scanner log (48.17 KB, text/plain)
2011-01-17 14:11 UTC, Yeti
Details

Description Yeti 2011-01-17 14:11:33 UTC
Created attachment 178512 [details]
g-ir-scanner log

Including the standard C99 header complex.h [from glibc headers] in an introspected package leads to an afwul lots errors similar to

/usr/include/bits/cmathcalls.h:129: syntax error, unexpected identifier, expecting ')' or ',' in 'extern long double creall (long double _Complex __z) __attribute__ ((__nothrow__)); extern long double __creall (long double _Complex __z) __attribute__ ((__nothrow__));' at '__z'

Steps to reproduce:

=====[ foo.h ]=====
#include <complex.h>
int foo_do(int x);

=====[ foo.c ]=====
#include "foo.h"
int foo_do(int x) { return x; }

===================
libtool --mode=compile gcc -c -o foo.lo foo.c
libtool --mode=link gcc -o libfoo.la foo.lo
g-ir-scanner --libtool="libtool" -I. --namespace=Foo --nsversion=1.0 --output=Foo-1.0.gir --pkg=glib-2.0 --include=GLib-2.0 --library=libfoo.la foo.c foo.h libfoo.la


Supporting complex numbers (that are present both in C and many target languages) would be of course nice, but for start I'd be happy if not supporting them didn't make so much noise.
Comment 1 Yeti 2011-01-22 09:15:22 UTC
Also in real-world use g-ir-scanner somehow gets completely confused and prints

/home/yeti/Projects/Gwyddion/GWYDDION-3-HEAD/libgwy/version.h:47: syntax error, unexpected $end in '# 47 "<stdin>" 2' at ''

where version.h is whatever file was given it last on the command line.  This specific file does not have 47 lines at all.

I cannot reproduce this problem with a trivial setup as in the original report, but not including complex.h makes it go away too.
Comment 2 André Klapper 2015-02-07 17:11:20 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]
Comment 3 Emmanuele Bassi (:ebassi) 2018-01-25 16:06:13 UTC
Fairly sure g-ir-scanner can cope with math.h and complex.h, these days; if that's not the case, I'd be happy to review a patch that added the tokens that make the lexxer choke to the list of ignored identifiers. Feel free to re-open the bug, if you have a patch.