bug-gnulib
[Top][All Lists]
Advanced

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

wcsncmp: Work around two ISO C compliance bugs on several platforms


From: Bruno Haible
Subject: wcsncmp: Work around two ISO C compliance bugs on several platforms
Date: Wed, 19 Apr 2023 18:05:20 +0200

Like wcscmp(), wcsncmp() has two ISO C compliance bugs on several platforms.
These two patches provide the workaround.

In particular, the module 'wcsncmp' is no longer obsolete.


2023-04-19  Bruno Haible  <bruno@clisp.org>

        wcsncmp: Add tests.
        * tests/test-wcsncmp.c: New file, based on tests/unistr/test-strncmp.h
        and tests/test-wcscmp.c.
        * modules/wcsncmp-tests: New file.

        wcsncmp: Work around two ISO C compliance bugs on several platforms.
        * lib/wchar.in.h (wcsncmp): Consider REPLACE_WCSNCMP.
        * lib/wcsncmp-impl.h (wcsncmp): Don't assume that the two wide
        characters are in the range 0..INT_MAX.
        * m4/wcsncmp.m4 (gl_FUNC_WCSNCMP): Test whether wcsncmp works for all
        wide characters. Set REPLACE_WCSNCMP.
        * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSNCMP.
        * modules/wchar (Makefile.am): Substitute REPLACE_WCSNCMP.
        * modules/wcsncmp (Status, Notice): Un-obsolete this module.
        (configure.ac): Consider REPLACE_WCSNCMP.
        * doc/posix-functions/wcsncmp.texi: Mention the two bugs.

Attachment: 0001-wcsncmp-Work-around-two-ISO-C-compliance-bugs-on-sev.patch
Description: Text Data

Attachment: 0002-wcsncmp-Add-tests.patch
Description: Text Data


reply via email to

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