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 |
New
|
Undecided
|
Unassigned | ||
lightdm (Debian) |
Fix Released
|
Unknown
|
Bug Description
Hi,
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:/
I have to admit I'm a bit unsure on how to fix that.
Changed in lightdm (Debian): | |
status: | Unknown → Incomplete |
Changed in lightdm (Debian): | |
status: | Incomplete → Confirmed |
Changed in lightdm (Debian): | |
status: | Confirmed → Fix Released |
To post a comment you must log in.
From the Debian report:
The system headers define: _((__nonnull_ _ (1))) pam_end( pam_handle_ t *pamh, int pam_status);
extern struct passwd *getpwnam (const char *__name) __attribute__ ((__nonnull__ (1)));
extern int __attribute_
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.