[Pkg-xfce-devel] Bug#811608: FTBFS with GCC 6: nonnull argument compared to NULL
corsac at debian.org
Fri Jan 22 11:59:09 UTC 2016
On jeu., 2016-01-21 at 15:31 -0800, Martin Michlmayr wrote:
> * Yves-Alexis Perez <corsac at debian.org> [2016-01-20 08:25]:
> > > Note that only the first error is reported; there might be more. You
> > > can find a snapshot of GCC 6 in experimental. To build with GCC 6,
> > > you can set CC=gcc-6 CXX=g++-6 explicitly.
> > Could you add a bit more information about this, especially the new
> > options
> > etc?
> You can find some of that here:
Thanks, but a quick search for null only reveals things about -Wnull-
> > > > glib-2.0
> > > > libsystem.c: In function 'getpwnam':
> > > > libsystem.c:859:14: error: nonnull argument 'name' compared to NULL [-
> > > > Werror=nonnull]
> > > > if (name == NULL)
> > This looks spurious. It's usually considered a *good* idea to check for
> > NULL
> > pointer, so I don't understand the error. Also, the code is:
> I'm no expert with this, but /usr/include/pwd.h defines:
> extern struct passwd *getpwnam (const char *__name) __nonnull ((1));
> Looking at the preprocessed source of libsystem I see this e.g.
> extern struct passwd *getpwnam (const char *__name) __attribute__
> ((__nonnull__ (1)));
> extern int __attribute__((__nonnull__ (1))) pam_end(pam_handle_t *pamh, int
> so it's marked as __nonnull__ but then you're checking if it's NULL,
> and this is what this warning is about (error because of -Werror).
> You can find more info about this warning and the rationale here:
Well, I can't find any help there, but digging a bit more at https://gcc.gnu.o
g_t_0040code_007bnonnull_007d-function-attribute-3192 there are more info
> > So:
> > - I fail to see how the compiler can statically know name is NULL
> Because of __nonnull__.
What I don't know if that this means *name is *guaranteed* to be non null (and
so we can safely remove the check) or if that means it the code needs to check
it beforehand (by the caller, for example).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 473 bytes
Desc: This is a digitally signed message part
More information about the Pkg-xfce-devel