help-flex
[Top][All Lists]
Advanced

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

Re: flex 2.5.31 filter.c bug and patch


From: John
Subject: Re: flex 2.5.31 filter.c bug and patch
Date: Wed, 16 Apr 2003 17:38:58 -0400 (EDT)

> On some systems filter.c fails to compile because stdin and stdout are
> never guaranteed to be lvalues (see ANSI C), but filter.c expects them
> them to be lvalues:
...
> *** filter.c.orig       Tue Mar 25 11:39:08 2003
> --- filter.c    Wed Apr 16 15:45:00 2003
> ***************
> *** 158,166 ****
>                         int     r;
>
>                         /* setup streams again */
> !                       if ((stdin = fdopen (0, "r")) == NULL)
>                                 flexfatal (_("fdopen(0) failed"));
> !                       if ((stdout = fdopen (1, "w")) == NULL)
>                                 flexfatal (_("fdopen(1) failed"));
>
>                         if ((r = chain->filter_func (chain)) == -1)
> --- 158,166 ----
>                         int     r;
>
>                         /* setup streams again */
> !                       if (fdopen (0, "r") == NULL)
>                                 flexfatal (_("fdopen(0) failed"));
> !                       if (fdopen (1, "w") == NULL)
>                                 flexfatal (_("fdopen(1) failed"));
>
>                         if ((r = chain->filter_func (chain)) == -1)


Thanks. We are aware of this problem. Linux allows stdin and stdout to
be lvalues, but the rest of the world, including ANSI, does not
guarantee it. The above patch won't work, by the way, because stdin
and stdout are not always connected to file descriptors 0 and 1,
respectively. -John





reply via email to

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