This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: malloc.c defining an assert macro


On Sat, 27 Jan 2018, Samuel Thibault wrote:

> Hello,
> 
> In hurd builds, we get
> 
> malloc.c:284:0: warning: "assert" redefined
>  # define assert(expr) \
> 
> In file included from ../include/assert.h:1:0,
>                  from ../sysdeps/mach/hurd/i386/tls.h:79,
>                  from ../sysdeps/i386/atomic-machine.h:20,
>                  from ../include/atomic.h:50,
>                  from malloc.c:216:
> ../assert/assert.h:107:0: note: this is the location of the previous definition
>  #  define assert(expr)       \
> 
> This is because <assert.h> happens to get pulled in by tls.h.
> 
> Should malloc.c perhaps #undef assert before redefining it?

First, is there any reason malloc.c needs its own assert macro?  If the 
standard one is just as good, making malloc.c include <assert.h> and not 
define its own macro at all would be the obvious fix.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]