g_atexit is defined when not declared
Submitted by John E
Link to original bug (#689214)
Description
In glib/gutils.h, the function 'g_atexit()' is only declared when G_DISABLE_DEPRECATED is NOT defined. In particular, the type GVoidFunc is only typedef'd in the same scenario.
However in glib/gutils.c, g_atexit() is defined regardless of whether or not it was declared. That in itself isn't a great problem - but g_atexit() uses GVoidFunc (which won't be typedef'd if G_DISABLE_DEPRECATED is defined).
In glib/gutils.c, the definition should probably be guarded, like so:-
#ifndef G_DISABLE_DEPRECATED void g_atexit (GVoidFunc func) { // rest of the function } #endif
Although this isn't specifically a Windows problem, my compiler (MSVC) complains if the above guard isn't present (MSVC complains that GVoidFunc is an unknown type).
Version: 2.35.x