Re: [PATCH] basename.3: SYNOPSIS: Add missing 'const'

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

 



Hi Michael,

On 5/10/21 1:59 AM, Michael Kerrisk (man-pages) wrote:
Hi Alex,

On 5/10/21 9:38 AM, Alejandro Colomar wrote:
Glibc uses 'const' for the basename() parameter.
Fix the prototype.

Yes, but see basename(3p):

     SYNOPSIS
        #include <libgen.h>

        char *basename(char *path);

        ...

        The basename() function may modify the string pointed to by  path,
        and may return a pointer to internal storage. The returned pointer
        might be invalidated or the storage might be overwritten by a sub‐
        sequent  call  to  basename().  The returned pointer might also be
        invalidated if the calling thread is terminated.

I'll skip this patch.

It's POSIX that states that, so yes, I'll drop it.

Cheers,

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