Hi,
I noticed that still lots of packages that use GObject are not disable
GObject cast checks in their builds. *It is a safe thing to do*. The
macro is doing a cast, if checking is enabled it checks and warn in the
case of an mismatch. The check is pointless in device that is running a
PR image as we have the (sys)logging turned off. So we can also turn off
the checks (the checks are not preventing anything). This makes binaries
smaller and faster.
One can easily see what is affected:
for i in `find /usr/ -type f`; do
objdump 2>/dev/null -T $i | grep -q g_type_check_instance_cast && echo $i;
done
or even get the package name:
objdump 2>/dev/null -T $i | grep -q g_type_check_instance_cast && dpkg
-S $i | cut -d: -f1
The check is turned off by adding -D G_DISABLE_CAST_CHECKS to CFLAGS.
Some projects do that in configure.{ac,in}
if test "x$enable_debug" = "xyes"; then
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
GTK_DEBUG_FLAGS="-DG_ENABLE_DEBUG -DG_ERRORCHECK_MUTEXES"
else
if test "x$enable_debug" = "xno"; then
GTK_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS
-DG_DISABLE_CAST_CHECKS"
else
GTK_DEBUG_FLAGS="-DG_DISABLE_CAST_CHECKS"
fi
fi
http://maemo.gitorious.org/hildon/gtk/blobs/master/configure.in#line282
some in their debian/rules
ifeq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -DG_DISABLE_CAST_CHECKS
endif
http://maemo.gitorious.org/maemo-multimedia/gstreamer/blobs/maemo5/debian/rules
I wonder if it would make sense to disable this globally on the package
builder. Having the check enabled is most useful in conjunction with
defining G_DEBUG="fatal_warnings" and checking for coredumps.
Stefan
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers