You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Greg Stein <gs...@lyra.org> on 2000/04/12 01:29:20 UTC
Re: cvs commit: apache-2.0/src/lib/apr/file_io/unix readwrite.c
Or the He-Man way:
*((char *)buf)++ = ...
:-)
On 11 Apr 2000 trawick@locus.apache.org wrote:
> trawick 00/04/11 07:08:34
>
> Modified: src/lib/apr/file_io/unix readwrite.c
> Log:
> Fix compile error on OS/390 in ap_read().
>
> Revision Changes Path
> 1.37 +2 -1 apache-2.0/src/lib/apr/file_io/unix/readwrite.c
>
> Index: readwrite.c
> ===================================================================
> RCS file: /home/cvs/apache-2.0/src/lib/apr/file_io/unix/readwrite.c,v
> retrieving revision 1.36
> retrieving revision 1.37
> diff -u -r1.36 -r1.37
> --- readwrite.c 2000/04/10 12:16:40 1.36
> +++ readwrite.c 2000/04/11 14:08:34 1.37
> @@ -108,7 +108,8 @@
>
> if (thefile->ungetchar != -1) {
> used_unget = TRUE;
> - *(char *)buf++ = (char)thefile->ungetchar;
> + *(char *)buf = (char)thefile->ungetchar;
> + buf = (char *)buf + 1;
> (*nbytes)--;
> thefile->ungetchar = -1;
> }
>
>
>
>
--
Greg Stein, http://www.lyra.org/
Re: cvs commit: apache-2.0/src/lib/apr/file_io/unix readwrite.c
Posted by Ben Laurie <be...@algroup.co.uk>.
dean gaudet wrote:
>
> On Tue, 11 Apr 2000, Greg Stein wrote:
>
> > Or the He-Man way:
> >
> > *((char *)buf)++ = ...
>
> i think this is a gcc extension (although maybe it's in C99 now) -- in C89
> the result of a cast is always an rvalue; and ++ requires an lvalue.
*(*(char **)&buf)++ = ...
Maybe?
Cheers,
Ben.
--
http://www.apache-ssl.org/ben.html
Re: cvs commit: apache-2.0/src/lib/apr/file_io/unix readwrite.c
Posted by Jeff Trawick <tr...@bellsouth.net>.
> On Tue, 11 Apr 2000, Greg Stein wrote:
>
> > Or the He-Man way:
> >
> > *((char *)buf)++ = ...
>
> i think this is a gcc extension (although maybe it's in C99 now) -- in C89
> the result of a cast is always an rvalue; and ++ requires an lvalue.
>
> -dean
I was hoping to get a chance to cut and paste the error message that
he-men get when they try that with c89 on OS/390, but there is no need
now as you have repeated the key part ("++ requires an lvalue").
--
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...
Re: cvs commit: apache-2.0/src/lib/apr/file_io/unix readwrite.c
Posted by dean gaudet <dg...@arctic.org>.
On Tue, 11 Apr 2000, Greg Stein wrote:
> Or the He-Man way:
>
> *((char *)buf)++ = ...
i think this is a gcc extension (although maybe it's in C99 now) -- in C89
the result of a cast is always an rvalue; and ++ requires an lvalue.
-dean