[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: |
Sat, 20 Feb 1999 10:23:39 -0700 (MST) |
In a recent note, address@hidden said:
> Date: Sat, 20 Feb 1999 09:23:27 -0700 (MST)
>
> ERROR CBC3025 ./../../lynx2-8-2/src/LYReadCFG.c:1043
> Operand must be a modifiable lvalue.
>
> #define FREE(x) if (x) {free(x); x = NULL;}
> [ ... ]
> FREE((char *)q->str_value);
>
Well, I can fake out the OS/390 compiler, be it bug or obsession
with the patch attached. But a couple thoughts:
Shouldn't macros always bracket all their arguments:
#define FREE(x) if (x) {free(x); (x) = NULL;}
^ ^
Mightn't the second FREE as well be:
! free((char *)q->str_value); q->str_value = NULL;
There's no use checking that a pointer is non-null when
inside a conditional that already makes the test.
========================================================================
%%% Created Sat Feb 20 10:03:12 MST 1999 by target lynx.patch. %%%
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: