3 GLib's configure options and corresponding macros
4 =================================================
7 -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS
8 --enable-debug=minimum [default for stable branches]
10 --enable-debug=yes [default for development branches]
13 Besides these, there are some local feature specific options, but my main
14 focus here is to concentrate on macros that affect overall GLib behaviour
15 and/or third party code.
18 Notes on GLib's internal and global macros
19 ==========================================
22 The g_assert() and g_assert_not_reached() become non-functional
23 with this define. The motivation is to speed up end-user apps by
24 avoiding expensive checks.
25 This macro can affect third-party code. --enable-debug=no will only
26 disable the assertion macros for GLib itself, but third-party code
27 that passes -DG_DISABLE_ASSERT to the compiler upon its own build
28 will end up with the non-functional variants after including glib.h
30 NOTE: Code inside the assertion macros should not have side effects
31 that affect the operation of the program.
33 This macro is similar to G_DISABLE_ASSERT, it affects third-party
34 code as mentioned above and the NOTE about G_DISABLE_ASSERT applies
35 too. The macros that become non-functional here are
36 g_return_if_fail(), g_return_val_if_fail(), g_return_if_reached() and
37 g_return_val_if_reached().
38 Additionally the glib_mem_profiler_table and g_mem_profile() from
39 gmem.h become non-functional if this macro is supplied.
40 This macro also switches off certain checks in the GSignal code.
42 Quite a bit of additional debugging code is compiled into GLib for this
43 macro, and since it is a globally visible define, third-party code may
44 be affected by it similar to G_DISABLE_ASSERT.
45 The additional code executed/compiled for this macro currently involve:
46 - extra validity checks for GDate
47 - memory profiling traps in gmem.c (consult debugging.txt for details)
48 - BREAKPOINT abortion for fatal log levels in gmessage.c instead of
49 plain abort() to allow debuggers trapping and overriding them
50 - added verbosity of gscanner.c to catch deprecated code paths
51 - added verbosity of gutils.c to catch deprecated code paths
52 - object ref/unref traps (consult debugging.txt) and object bookkeeping
54 - extra validity checks in gsignal.c