diff options
author | Thomas Haller <thaller@redhat.com> | 2022-04-07 11:17:52 +0200 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2022-09-02 14:51:46 +0000 |
commit | cde5de91af47cf5b2ded326d0b0c5ae46d5d96df (patch) | |
tree | 1cb06b6d848930fbfaa9aa4db77997717223eeb6 /NEWS | |
parent | f36892954302b52a027073a96a6d61b0feea6f8d (diff) | |
download | gobject-introspection-cde5de91af47cf5b2ded326d0b0c5ae46d5d96df.tar.gz |
giscanner: undef "GLIB_VERSION_{MAX_ALLOWED,MIN_REQUIRED}" macros in generated C file
When g-ir-scanner is used by another project, than that project might
have the GLIB_VERSION_* macros defined. This is useful to ensure that
only intended glib API is used.
The project might then also pass the CFLAGS to g-ir-scanner, without
filtering those defines out. This can lead to compiler warnings.
For example, NetworkManager sets the version macros to GLIB_VERSION_2_40
and thus gets these warnings
/NetworkManager/tmp-introspect66917zc4/NM-1.0.c: In function ‘dump_object_type’:
/NetworkManager/tmp-introspect66917zc4/NM-1.0.c:252:13: warning: Not available before 2.70
252 | if (G_TYPE_IS_FINAL (type))
| ^~~~~~~~~~~~~~~~~
/NetworkManager/tmp-introspect66917zc4/NM-1.0.c: In function ‘dump_fundamental_type’:
/NetworkManager/tmp-introspect66917zc4/NM-1.0.c:370:13: warning: Not available before 2.70
370 | if (G_TYPE_IS_FINAL (type))
| ^~~~~~~~~~~~~~~~~
But these warnings are not correct. The installed g-ir-scanner knows for which
glib version to generate code. Undefine the macros to avoid the warning.
Diffstat (limited to 'NEWS')
0 files changed, 0 insertions, 0 deletions