[PATCH] fix #19443 - build failures with -DDEBUG

Martin Sebor msebor@gmail.com
Tue Jan 12 20:37:00 GMT 2016


A number of glibc source files contain debugging code guarded
by the "#if DEBUG" preprocessor conditional.  The DEBUG macro
isn't documented but as Carlos notes in his comment on the bug,
it can be useful to enable various debugging aspects of glibc,
for example in the resolver library.

The attached patch makes it possible to build glibc with the macro
defined.  In one instance (time/mktime.c) the macro is being used
in a way that's incompatible with the other uses. In that case I
renamed to avoid this problem.

In case that raises questions, in resolv/res_send.c, I chose
to replace the undeclared abort with __builtin_abort to avoid
(mostly) unnecessarily including <stdlib.h>.  I checked for
uses of other GCC builtins and found a bunch, though not any
of __builtin_abort.  Either approach works for me.

Tested by building and using the library on powerpc64le and
x86_64 with the macro defined.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glibc-19443.patch
Type: text/x-patch
Size: 3813 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160112/a1bad972/attachment.bin>


More information about the Libc-alpha mailing list