[Bug string/34466] string.h with _POSIX_C_SOURCE=202405L: strlcpy(), strlcat(), memmem() not declared

"roman.zilka at gmail dot com via Glibc-bugs" <[email protected]> Thu, 30 Jul 2026 16:07:28 +0000
Newsgroups gmane.comp.lib.glibc.bugs
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=3D34466

Roman =C5=BDilka <roman.zilka at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|string.h with               |string.h with
                   |_POSIX_C_SOURCE=3D202405L:    |_POSIX_C_SOURCE=3D202405=
L:
                   |strlcpy(), strlcat() not    |strlcpy(), strlcat(),
                   |declared                    |memmem() not declared

--- Comment #1 from Roman =C5=BDilka <roman.zilka at gmail dot com> ---
Same story with memmem().

$ cat memmem-posix2024.c
#include <string.h>
int main() {
        memmem("a", 2, "a", 2);
}

$ gcc -std=3Dc17 -pedantic -D_POSIX_C_SOURCE=3D202405L memmem-posix2024.c
memmem-posix2024.c: In function =E2=80=98main=E2=80=99:
memmem-posix2024.c:3:9: error: implicit declaration of function =E2=80=98me=
mmem=E2=80=99; did
you mean =E2=80=98memset=E2=80=99? [-Wimplicit-function-declaration]
    3 |         memmem("a", 2, "a", 2);
      |         ^~~~~~
      |         memset

--=20
You are receiving this mail because:
You are on the CC list for the bug.=