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 758691 - g-ir-scanner doesn't "export" constants (macros) defined using other constants (macros) in some cases
g-ir-scanner doesn't "export" constants (macros) defined using other constant...
Status: RESOLVED OBSOLETE
Product: gobject-introspection
Classification: Platform
Component: g-ir-scanner
1.46.x
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-11-26 09:37 UTC by Vratislav Podzimek
Modified: 2018-02-08 12:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sources demonstrating the issue (731 bytes, application/gzip)
2015-11-26 09:37 UTC, Vratislav Podzimek
Details

Description Vratislav Podzimek 2015-11-26 09:37:26 UTC
Created attachment 316289 [details]
sources demonstrating the issue

Description of problem:
Best described with an example code:
#define TEST_DATA_CONST1 10
#define TEST_DATA_CONST2 *10
#define TEST_DATA_CONST3 (TEST_DATA_CONST1 TEST_DATA_CONST2)

If the above code is a part of the header file (attached) that is GI-introspected, only the TEST_DATA_CONST1 is "exported" (defined in the namespace).

Version-Release number of selected component (if applicable):
gobject-introspection-devel-1.42.0-1.fc21.x86_64

How reproducible:
100 %

Steps to Reproduce:
1. use the test_data.c and test_data.h files to create a GI-introspected library
2. try to get the TEST_DATA_CONST3 e.g. from python

$ gcc -fPIC -c -o test_data.o `pkg-config --cflags glib-2.0 gobject-2.0` test_data.c
$ gcc -shared -o test_data.so `pkg-config --libs glib-2.0 gobject-2.0` test_data.o
$ LD_LIBRARY_PATH=. g-ir-scanner `pkg-config --libs --cflags glib-2.0 gobject-2.0` --identifier-prefix=Test --symbol-prefix=test --namespace Test --nsversion=1.0 --library test_data --warn-all -o Test-1.0.gir test_data.c test_data.h
$ g-ir-compiler Test-1.0.gir > Test-1.0.typelib
$ GI_TYPELIB_PATH=. LD_LIBRARY_PATH=. ipython

Actual results:
no TestData.CONST3 in the TestData module/namespace

Expected results:
TestData.CONST3 in the TestData module/namespace as it is a valid constant and preprocessor expands it to the right value just fine
Comment 1 GNOME Infrastructure Team 2018-02-08 12:40:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gobject-introspection/issues/152.