Skip to content

Avoid some warnings from GObject-Introspection

Simon McVittie requested to merge wip/smcv/gi-warnings into main
  • gstrfuncs: Use separate preprocessor conditionals for g-i and gtk-doc

    GObject-Introspection and gtk-doc both parse C headers using regular expressions, so they can easily be confused by non-trivial conditions. GObject-Introspection warns about this:

      .../gstrfuncs.h:151: the __GI_SCANNER__ constant should only be used with simple #ifdef or #endif: #if  !defined (__GTK_DOC_IGNORE__) && !defined (__GI_SCANNER__)

    In this case it's very easy to convert the compound expression into nesting.

  • gtimezone: Avoid a nested preprocessor conditional to be nice to g-i

    GObject-Introspection seems to become confused by the nested conditional followed by an #elif clause for the outer conditional, and issues this warning:

    .../gtimezone.c:830: mismatched #elif defined (G_OS_WIN32)

Noticed while testing gobject-introspection!258 (merged).

Merge request reports