Re: strlen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jonny, Florian, Michael,

On 7/7/21 6:57 PM, Alejandro Colomar (man-pages) wrote:
Maybe the man page could just state:


NOTES

The calling strlen with a NULL pointer is undefined behavior.

Okay.  I agree that should probably be documented.
I'm surprised it's not documented already.  Not even in the glibc manual (or I couldn't find it).

There are a lot of functions that should get this addition, though.  I'd like to patch them all at once.  I'll try to find a list of functions documented in the man pages and that have nonnull in the oimplementation.  If I don't come back soon with a list, please ping me.

Humm, the list is huge, much bigger than I expected...

Just try yourselves:

~/src/gnu/glibc$ man_lsfunc ../../linux/man-pages/man3 > lsfunc;
~/src/gnu/glibc$ cat lsfunc \
                 | while read f; do \
                         grep_glibc_prototype $f \
                         | grep nonnull >/dev/null \
                         && grep_glibc_prototype $f; \
                 done \
                 > nonnull;
~/src/gnu/glibc$ wc -l  nonnull;
296 nonnull


grep_glibc_prototype is defined in the man-pages, in <scripts/bash_aliases>.

How do you think this should be handled?
Adding a line in NOTES for every such function? Adding [[gnu::nonnull]] to every such prototype in SYNOPSIS (this might be too noisy)? Else?


Thanks,

Alex

--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux