lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev lynx2.8.2dev.17


From: pg
Subject: Re: lynx-dev lynx2.8.2dev.17
Date: Mon, 22 Feb 1999 10:06:16 -0700 (MST)

In a recent note, address@hidden said:

> Date: Sat, 20 Feb 1999 10:23:39 -0700 (MST)
> 
> diff -brc orig/lynx2-8-2/src/LYReadCFG.c lynx2-8-2/src/LYReadCFG.c
> *** orig/lynx2-8-2/src/LYReadCFG.c Wed Feb 17 07:29:33 1999
> --- lynx2-8-2/src/LYReadCFG.c Sat Feb 20 09:55:44 1999
> ***************
> *** 1040,1046 ****
>       case CONF_ENV:
>           if (q->str_value != 0) {
>               FREE(*(q->str_value));
> !             FREE((char *)q->str_value);
>           }
>           break;
>       default:
> --- 1040,1046 ----
>       case CONF_ENV:
>           if (q->str_value != 0) {
>               FREE(*(q->str_value));
> !             FREE(*(char **)&(q->str_value));
>           }
>           break;
>       default:
> 
The relevant section of ANSI(R) X3.159-1989 appears to be:
 
    3.2.1.1 Lvalues and Function Designators
        [ ... ]
    Except when it is the operand of the sizeof operator, the unary
    & operator, the ++ operator, the -- operator, or the left operand
    of the . operator or an assignment operator, an lvalue that does
    not have array type is converted to the value stored in the
    designated object (and is no longer an lvalue).
 
(and 3.3.4 says that the operand of a cast must be a scalar type,
and 3.1.2.5 says that scalar types are not array types, so a
cast can never result in an lvalue.)
 
So OS/390's c89 is being properly conscientious here.

And I see plenty other uses of the FREE macro in LYReadCFG.c with
no cast, and an operand type other than (char *).  So I surmise
that the cast is unnecessary, and it should suffice to:

!               FREE(q->str_value);

-- gil

reply via email to

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