This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/18641] pwd.h: add __nonnull markings


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]