bug-gnulib
[Top][All Lists]
Advanced

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

verify N3322 functionality


From: Bruno Haible
Subject: verify N3322 functionality
Date: Tue, 05 Nov 2024 22:42:14 +0100

Paul Eggert wrote in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-10/msg00032.html>:

> Yes, it was accepted by WG14 last week. See:
>
> https://sourceware.org/pipermail/libc-alpha/2024-October/160375.html

While Gnulib cannot do anything for the NULL + 0 and NULL - NULL expressions
(these need to be fixed in the compilers), Gnulib can help for the function
calls.

Here are patches that verify the Gnulib requirements for the cited functions.
For two of them (strndup and wcsncat) I had to add workarounds for specific
functions.

Other than that, test failures only happen with the undefined-behaviour
sanitizer.

* With CC="gcc -fsanitize=undefined -fno-sanitize-recover=undefined":
FAIL: test-bsearch
FAIL: test-memccpy
FAIL: test-memcpy
FAIL: test-memmove
FAIL: test-memset
FAIL: test-memset_explicit
FAIL: test-qsort
FAIL: test-strncat
FAIL: test-strncpy
FAIL: test-strndup
FAIL: test-wcsncmp
FAIL: test-wcsncpy

* With CC="clang -fsanitize=undefined -fno-sanitize-recover=undefined":
FAIL: test-bsearch
FAIL: test-memccpy
FAIL: test-memchr
FAIL: test-memcpy
FAIL: test-memmove
FAIL: test-memset
FAIL: test-memset_explicit
FAIL: test-qsort
FAIL: test-strncat
FAIL: test-strncpy
FAIL: test-strndup
FAIL: test-wcsncpy

I don't think it's worth adding workarounds for these test failures, because
  - Building with sanitizer and -fno-sanitize-recover=... is not the usual way
    of building programs.
  - Bug reports for glibc, gcc, clang are already registered.

Bruno


2024-11-05  Bruno Haible  <bruno@clisp.org>

        wmemset tests: Verify N3322 functionality.
        * tests/test-wmemset.c: New file.
        * modules/wmemset-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        wmemchr tests: Verify N3322 functionality.
        * tests/test-wmemchr.c: New file.
        * modules/wmemchr-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        wmemcmp tests: Verify N3322 functionality.
        * tests/test-wmemcmp.c (main): Add zero-size tests.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        wcsncmp tests: Verify N3322 functionality.
        * tests/test-wcsncmp.c (main): Add zero-size tests.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        wcsncat tests: Verify N3322 functionality.
        * tests/test-wcsncat.c: New file.
        * modules/wcsncat-tests: New file.

        wcsncat: Guarantee N3322 functionality.
        * lib/wchar.in.h (wcsncat): Consider REPLACE_WCSNCAT.
        * m4/wcsncat.m4 (gl_FUNC_WCSNCAT): Test whether the zero-length bug is
        present.
        * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSNCAT.
        * modules/wchar (Makefile.am): Substitute REPLACE_WCSNCAT.
        * modules/wcsncat (Status, Notice): Remove.
        (configure.ac): Consider REPLACE_WCSNCAT.
        * doc/posix-functions/wcsncat.texi: Mention the zero-length bug.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        wmemmove tests: Verify N3322 functionality.
        * tests/test-wmemmove.c: New file.
        * modules/wmemmove-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        wmemcpy tests: Verify N3322 functionality.
        * tests/test-wmemcpy.c: New file.
        * modules/wmemcpy-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        wcsncpy tests: Verify N3322 functionality.
        * tests/test-wcsncpy.c: New file.
        * modules/wcsncpy-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        memset_explicit tests: Verify N3322 functionality.
        * tests/test-memset_explicit.c (main): Add a zero-size test.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        memset tests: Verify N3322 functionality.
        * tests/test-memset.c: New file.
        * modules/memset-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        memchr tests: Verify N3322 functionality.
        * tests/test-memchr.c (main): Add a zero-size test.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        strncmp tests: Verify N3322 functionality.
        * modules/strncmp: New file.
        * doc/posix-functions/strncmp.texi: Mention the new module.
        * tests/test-strncmp.c: New file.
        * modules/strncmp-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        memcmp tests: Verify N3322 functionality.
        * tests/test-memcmp.c (main): Add zero-size tests.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        strncat tests: Verify N3322 functionality.
        * tests/test-strncat.c (main): Add a zero-size test.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        strndup tests: Verify N3322 functionality.
        * tests/test-strndup.c: New file.
        * modules/strndup-tests: New file.

        strndup: Guarantee N3322 functionality.
        * m4/strndup.m4 (gl_FUNC_STRNDUP): Check against the AIX bug.
        * doc/posix-functions/strndup.texi: Mention the AIX bug.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        strncpy tests: Verify N3322 functionality.
        * modules/strncpy: New file.
        * doc/posix-functions/strncpy.texi: Mention the new module.
        * tests/test-strncpy.c: New file.
        * modules/strncpy-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        memmove tests: Verify N3322 functionality.
        * tests/test-memmove.c: New file.
        * modules/memmove-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        memccpy tests: Verify N3322 functionality.
        * modules/memccpy: New file.
        * doc/posix-functions/memccpy.texi: Mention the new module.
        * tests/test-memccpy.c: New file.
        * modules/memccpy-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        memcpy tests: Verify N3322 functionality.
        * tests/test-memcpy.c: New file.
        * modules/memcpy-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        qsort tests: Verify N3322 functionality.
        * modules/qsort: New file.
        * doc/posix-functions/qsort.texi: Mention the new module.
        * tests/test-qsort.c: New file.
        * modules/qsort-tests: New file.

2024-11-05  Bruno Haible  <bruno@clisp.org>

        bsearch tests: Verify N3322 functionality.
        * modules/bsearch: New file.
        * doc/posix-functions/bsearch.texi: Mention the new module.
        * tests/test-bsearch.c: New file.
        * modules/bsearch-tests: New file.

Attachment: 0001-bsearch-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0002-qsort-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0003-memcpy-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0004-memccpy-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0005-memmove-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0006-strncpy-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0007-strndup-Guarantee-N3322-functionality.patch
Description: Text Data

Attachment: 0008-strndup-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0009-strncat-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0010-memcmp-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0011-strncmp-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0012-memchr-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0013-memset-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0014-memset_explicit-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0015-wcsncpy-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0016-wmemcpy-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0017-wmemmove-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0018-wcsncat-Guarantee-N3322-functionality.patch
Description: Text Data

Attachment: 0019-wcsncat-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0020-wcsncmp-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0021-wmemcmp-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0022-wmemchr-tests-Verify-N3322-functionality.patch
Description: Text Data

Attachment: 0023-wmemset-tests-Verify-N3322-functionality.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]