lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev Re: LYNX-DEV lynx_w32.zip feedback


From: pg
Subject: Re: lynx-dev Re: LYNX-DEV lynx_w32.zip feedback
Date: Wed, 15 Apr 1998 09:16:12 -0600 (MDT)

In a recent note, T.E.Dickey said:

> Date: Wed, 15 Apr 1998 09:34:12 -0400 (EDT)
> 
> > On Wed, 15 Apr 1998, T.E.Dickey wrote: 
> >  
> > > I think we should replace all of the 
> > >   if(TRACE)fprintf(stderr,....) 
> > > with a call that hides the function pointer, and #define'd to allow 
> > > removing 
> > > it entirely: 
> > >  
> > > #define DPRINTF(p) dprintf p; 
> > >  
> > > (yes, I'm aware that it would run about 1% slower if we pass all of that 
> > > stuff on the stack - but it would be much simpler to maintain). 
> >  
Yay!  This needs to be done.  I gagged when I saw in LYMain.C:

        *stderr = *LYTraceLogFP;

-- I wondered, "Are you supposed to be able to do that?"  The answer
is, "No.  See ANSI C, Sect. 4.9.3 Files":

    [ ... ]
        The address of the FILE object used to control a stream may be
    significant; a copy of the FILE object may not necessarily serve in
    place of the original.

> We could work around that by making the macro have the if statement
> the way it does now:
>       #define DPRINTF(p) if (TRACE) dprintf p
> 
Or, should it be:

>       #define DPRINTF(p) { if (TRACE) dprintf p; }

to avoid dangling-else problems?  The syntax of C leaves no proper way
to do this.

<make_finger_down_throat_gesture>
> to make it reliable as well, we'd probably do what I've seen in other places
> (close & reopen the file after each message).
> 
</make_finger_down_throat_gesture>
-- but that could also be made optional with a macro.

-- gil

reply via email to

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