bug-gnulib
[Top][All Lists]
Advanced

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

Re: [patch] strerror return value


From: Bruno Haible
Subject: Re: [patch] strerror return value
Date: Wed, 14 Oct 2020 03:08:33 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-189-generic; KDE/5.18.0; x86_64; ; )

Hi,

Philipp Klaus Krause wrote:
> gnulib contains some calls to strerror where the result is assigned
> to a char *. However, according to the strerror specification, the
> string returned by strerror should never be changed, so it would be
> better to use const char * instead.

Good point. Yes, indeed.

> For the 4 others,see the attached small patch.

For the uses in the Autoconf tests, it's actually better to use 'char *',
so that we notice if some system mistakenly declares the function with
a wrong return type.

But regarding the code in lib/ and tests/ you are right. I applied that change
in your name, with this ChangeLog entry:


2020-10-13  Philipp Klaus Krause  <pkk@spth.de>  (tiny change)

        Don't declare an intention to modify the return value of strerror.
        * tests/test-perror2.c (main): Assign the return value of strerror to a
        'const char *' variable.




reply via email to

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