FTBFS with gcc -6 / -Werror=nonnull

Bug #1537797 reported by Yves-Alexis Perez
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Light Display Manager
lightdm (Debian)
Fix Released

Bug Description


I got a report that lightdm was failing to build with gcc 6, where apparently -Werror=nonnull is passed:

> libsystem.c: In function 'getpwnam':
> libsystem.c:859:14: error: nonnull argument 'name' compared to NULL [-Werror=nonnull]
> if (name == NULL)

You can find more info in the downstream bug report at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811608

I have to admit I'm a bit unsure on how to fix that.

Changed in lightdm (Debian):
status: Unknown → Incomplete
Revision history for this message
Robert Ancell (robert-ancell) wrote :

From the Debian report:

The system headers define:
extern struct passwd *getpwnam (const char *__name) __attribute__ ((__nonnull__ (1)));
extern int __attribute__((__nonnull__ (1))) pam_end(pam_handle_t *pamh, int pam_status);

So the compiler considers that 'name' can never be NULL and my check is therefore an error.

In this case it's probably safe to drop these checks. because these are just mock functions.

Revision history for this message
Yves-Alexis Perez (corsac) wrote :

Does this mean though one is supposed to check that name is not NULL *before* calling getpwnam?

Changed in lightdm (Debian):
status: Incomplete → Confirmed
Changed in lightdm (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.