bug-gnulib
[Top][All Lists]
Advanced

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

Re: mingw strtol bug


From: Bruno Haible
Subject: Re: mingw strtol bug
Date: Fri, 02 Apr 2021 21:00:21 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-206-generic; KDE/5.18.0; x86_64; ; )

Hi Eric,

> I ran into a mingw bug on strtol() today, and don't see it documented or
> worked around in gnulib:

Thanks for the report and test case. The functions strtoul(), strtoll(),
strtoull() are equally affected. I'm adding workarounds to gnulib.


2021-04-02  Bruno Haible  <bruno@clisp.org>

        strtoul, strtoll, strtoull: Fix compilation warning.
        * lib/strtol.c (strtol): Undefine before defining as a macro.

2021-04-02  Bruno Haible  <bruno@clisp.org>

        strtoll: Work around a bug on native Windows and Minix.
        * lib/stdlib.in.h (strtoll): Override if REPLACE_STRTOLL is 1.
        * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_STRTOLL.
        * m4/strtoll.m4 (gl_FUNC_STRTOLL): Test whether strtoll works. Set
        REPLACE_STRTOLL.
        * modules/stdlib (Makefile.am): Substitute REPLACE_STRTOLL.
        * modules/strtoll (configure.ac): Test REPLACE_STRTOLL.
        * tests/test-strtoll.c (main): Add tests of hexadecimal integer syntax.
        * doc/posix-functions/strtoll.texi: Mention the bug.

2021-04-02  Bruno Haible  <bruno@clisp.org>

        strtol: Work around a bug on native Windows and Minix.
        * lib/stdlib.in.h (strtol): New declaration.
        * m4/stdlib_h.m4 (gl_STDLIB_H): Test whether strtol is declared.
        (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_STRTOL, HAVE_STRTOL,
        REPLACE_STRTOL.
        * m4/strtol.m4 (gl_FUNC_STRTOL): Require gl_STDLIB_H_DEFAULTS. Test
        whether strtol works. Set REPLACE_STRTOL.
        * modules/stdlib (Makefile.am): Substitute GNULIB_STRTOL, HAVE_STRTOL,
        REPLACE_STRTOL.
        * modules/strtol (Status, Notice): Remove.
        (Depends-on): Add stdlib.
        (configure.ac): Test HAVE_STRTOL and REPLACE_STRTOL. Invoke
        gl_STDLIB_MODULE_INDICATOR.
        * tests/test-strtol.c (main): Add tests of hexadecimal integer syntax.
        * doc/posix-functions/strtol.texi: Mention the bug.

2021-04-02  Bruno Haible  <bruno@clisp.org>

        strtoull: Work around a bug on native Windows and Minix.
        * lib/stdlib.in.h (strtoull): Override if REPLACE_STRTOULL is 1.
        * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_STRTOULL.
        * m4/strtoull.m4 (gl_FUNC_STRTOULL): Test whether strtoull works. Set
        REPLACE_STRTOULL.
        * modules/stdlib (Makefile.am): Substitute REPLACE_STRTOULL.
        * modules/strtoull (configure.ac): Test REPLACE_STRTOULL.
        * tests/test-strtoull.c (main): Add tests of hexadecimal integer syntax.
        * doc/posix-functions/strtoull.texi: Mention the bug.

2021-04-02  Bruno Haible  <bruno@clisp.org>

        strtoul: Work around a bug on native Windows and Minix.
        Reported by Eric Blake <eblake@redhat.com> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00082.html>.
        * lib/stdlib.in.h (strtoul): New declaration.
        * m4/stdlib_h.m4 (gl_STDLIB_H): Test whether strtoul is declared.
        (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_STRTOUL, HAVE_STRTOUL,
        REPLACE_STRTOUL.
        * m4/strtoul.m4 (gl_FUNC_STRTOUL): Require gl_STDLIB_H_DEFAULTS. Test
        whether strtoul works. Set REPLACE_STRTOUL.
        * modules/stdlib (Makefile.am): Substitute GNULIB_STRTOUL, HAVE_STRTOUL,
        REPLACE_STRTOUL.
        * modules/strtoul (Status, Notice): Remove.
        (Depends-on): Add stdlib.
        (configure.ac): Test HAVE_STRTOUL and REPLACE_STRTOUL. Invoke
        gl_STDLIB_MODULE_INDICATOR.
        * tests/test-strtoul.c (main): Add tests of hexadecimal integer syntax.
        * doc/posix-functions/strtoul.texi: Mention the bug.

2021-04-02  Bruno Haible  <bruno@clisp.org>

        strtol, strtoul, strtoll, strtoull: Optimize.
        * lib/strtol.c (GROUP_PARAM_PROTO): New macro.
        (INTERNAL): Define differently if !USE_NUMBER_GROUPING.
        (INTERNAL (strtol)): Define without 'int group' parameter if
        !USE_NUMBER_GROUPING.
        (strtol): Don't define if !USE_NUMBER_GROUPING.

2021-04-02  Bruno Haible  <bruno@clisp.org>

        strto*l: Don't pass invalid arguments to isspace, isalnum, toupper.
        * lib/strtol.c (ISSPACE, ISALPHA, TOUPPER): Cast argument to
        'unsigned char' before passing it to the functions isspace(), isalpha(),
        toupper().

Attachment: 0001-strto-l-Don-t-pass-invalid-arguments-to-isspace-isal.patch
Description: Text Data

Attachment: 0002-strtol-strtoul-strtoll-strtoull-Optimize.patch
Description: Text Data

Attachment: 0003-strtoul-Work-around-a-bug-on-native-Windows-and-Mini.patch
Description: Text Data

Attachment: 0004-strtoull-Work-around-a-bug-on-native-Windows-and-Min.patch
Description: Text Data

Attachment: 0005-strtol-Work-around-a-bug-on-native-Windows-and-Minix.patch
Description: Text Data

Attachment: 0006-strtoll-Work-around-a-bug-on-native-Windows-and-Mini.patch
Description: Text Data

Attachment: 0007-strtoul-strtoll-strtoull-Fix-compilation-warning.patch
Description: Text Data


reply via email to

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