bug-bash
[Top][All Lists]
Advanced

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

Re: [PATCH] Fix minor portability issues including ISO C 23 prototypes.


From: Chet Ramey
Subject: Re: [PATCH] Fix minor portability issues including ISO C 23 prototypes.
Date: Wed, 14 Feb 2024 14:56:22 -0500
User-agent: Mozilla Thunderbird

On 2/14/24 12:26 AM, Collin Funk wrote:
Hi, I noticed some compiler warnings that might be worth fixing. I
wasn't sure if patches should have ChangeLog entries so I left it
alone and tried to make it easy to copy paste for you. Feel free to
use or ignore changes as you see fit.

Thanks for the patches.


* lib/sh/getenv.c (getenv, putenv, setenv, unsetenv): Don't assume
that NULL is equivalent to 0 and just use the macro itself.

This isn't necessary in general; ISO C guarantees that a constant
expression with value 0 is a null pointer constant just like NULL,
and the compiler will make them equivalent even if the internal
representation of a null pointer isn't all zeroes.

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

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