This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/18641] pwd.h: add __nonnull markings
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 24 Jul 2015 14:44:12 +0000
- Subject: [Bug libc/18641] pwd.h: add __nonnull markings
- Auto-submitted: auto-generated
- References: <bug-18641-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=18641
Florian Weimer <fweimer at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fweimer at redhat dot com
Flags| |security-
--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Mike Frysinger from comment #0)
> per the thread:
> https://sourceware.org/ml/libc-alpha/2015-05/msg00867.html
>
> when you use many functions in pwd.h with NULL pointers, glibc will crash.
> POSIX doesn't require NULL to be supported, so we want to mark all the funcs
> as nonnull instead. this way user code is compiled with warnings and our
> API expectations are documented.
I couldn't find this discussed on the mailing list.
putpwent at least is documented as returning EINVAL for NULL arguments in its
manual page:
EINVAL Invalid (NULL) argument given.
And the code has checks for that. Future GCC versions may rewrite the NULL
check to an abort because of the nonnull attribute with just -O2 optimization.
I am not convinced this is what we want.
--
You are receiving this mail because:
You are on the CC list for the bug.