[Top][All Lists]

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

Re: lynx-dev (patch) problem with lynx 2.8.3dev.7

From: pg
Subject: Re: lynx-dev (patch) problem with lynx 2.8.3dev.7
Date: Thu, 26 Aug 1999 15:43:03 -0600 (MDT)

In a recent note, Klaus Weide said:

> Date: Thu, 26 Aug 1999 11:20:14 -0500 (CDT)
> > "/home/lwv26/i/src/Unix/lynx/t/lynx2-8-3/src/LYOptions.c", line 915: 
> > warning: a cast does not yield an lvalue
> It seems to be just a warning, not an error.  There were warnings of some
> kind (with gcc) in LYOptions.c earlier, before the assume_list change, so
> I wouldn't worry too much about it.  Maybe the warning goes away by replacing 
> FREE with free.
On OS/390, it's an error:

ERROR CBC3025 ./../../lynx2-8-3/src/LYOptions.c:915   Operand must be a 
modifiable lvalue.
FSUM3065 The COMPILE step ended with return code 12.
FSUM3017 Could not compile ../../lynx2-8-3/src/LYOptions.c. Correct the errors 
and try again.
gmake[1]: *** [LYOptions.o] Error 3

The problem is in FREE, which is:

    define FREE(x) if (x != 0) {free((char *)x); x = NULL;}

The "x = NULL;" is the problem, attempting to assign to a non-L-value.
The sleazy patch below cheats it successfully.

> The assume_list is a (CONST char**) not a (CONST char*), so casting it to
> (char*) is definitely wrong.
Ummm.  free() requires a (void *) (K&R: (char *)) as its argument.  It's
sorta Protean storage, so bizarre casts are excusable.

> I haven't looked at TYPECAST so I don't know whether that's what it
> expands to.
    address@hidden:845$ grep TYPECAST `find ..`            
TYPECAST(type,ptr) (type*)((long)(ptr))
    ../orig/lynx2-8-3/src/LYOptions.c:                  FREE(TYPECAST(char 

Its sole application is^H^Hwas the problematic one.  :-(  Is it best to 
eliminate it?

-- gil
%%% Created Thu Aug 26 15:20:37 MDT 1999 by target lynx.patch. %%%
diff -bru orig/lynx2-8-3/src/LYOptions.c lynx2-8-3/src/LYOptions.c
--- orig/lynx2-8-3/src/LYOptions.c      Thu Aug 26 05:31:19 1999
+++ lynx2-8-3/src/LYOptions.c   Thu Aug 26 15:20:19 1999
@@ -912,7 +912,7 @@
                            addstr(LYRawMode ? "ON " : "OFF");
-                   FREE(TYPECAST(char *,assume_list));
+                   FREE(*(char **) &assume_list);
                    response = ' ';
                    if (LYSelectPopups) {
 #if !defined(VMS) || defined(USE_SLANG)

reply via email to

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