This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: `sentinel' gcc-3.x/OpenBSD compat. [Re: [patch 1/3] Make obconcat use stdarg]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: mark dot kettenis at xs4all dot nl, gdb-patches at sourceware dot org
- Date: Sun, 2 May 2010 08:49:10 +0200
- Subject: Re: `sentinel' gcc-3.x/OpenBSD compat. [Re: [patch 1/3] Make obconcat use stdarg]
- References: <20100430181605.GA19190@host0.dyn.jankratochvil.net> <201004301908.o3UJ8mGf006742@glazunov.sibelius.xs4all.nl> <20100430221839.GA21100@host0.dyn.jankratochvil.net> <83eihww3yg.fsf@gnu.org>
On Sat, 01 May 2010 08:06:47 +0200, Eli Zaretskii wrote:
> > Date: Sat, 1 May 2010 00:18:39 +0200
> > From: Jan Kratochvil <jan.kratochvil@redhat.com>
> > Cc: gdb-patches@sourceware.org
> >
> > > I'm afraid you'll need an explicit cast for the NULLs used as the
> > > sentinel value, otherwise platforms that
> > >
> > > #define NULL 0L
> > >
> > > will generate warnings like:
> > >
> > > sentinel.c: In function 'foo':
> > > sentinel.c:8: warning: missing sentinel in function call
> > >
> > > and with -Werror, that's not a good :(.
> >
> > Which platforms?
>
> DJGPP (a.k.a. GO32) is one.
#include <stddef.h>
void f (int i, ...) __attribute__ ((__sentinel__));
void
f (int i, ...)
{
}
void
g (void)
{
f (1, NULL);
}
On gcc442b.zip it works correctly.
no warning:
f (1, NULL);
f (1, (void *)0);
f (1, ((void *)0)); /* output by gcc -E */
warning:
f (1, 0);
f (1, 0L);
Any other platform?
Thanks,
Jan