hi,
I compiled the same program with egcs-1.1.2 ans gcc-2.95 without any
problems. Maybe it is because of the glibc that you are using. Suggest you
try compiling with gcc-2.95.
HTH,
Raju
On Sat, 14 Aug 1999, Richard Gooch wrote:
> Kurt Wall writes:
> > Also sprach Richard Gooch:
> > > Hi, all. I've just tried compiling some code on a RedHat 6.0 system,
> > > and ran across a problem. I've written some test code that
> > > demonstrates the problem:
> > >
> > > % cat egcs-example.c
> > > #include <ctype.h>
> > >
> > > int func (char *array)
> > > {
> > > return tolower (array[0]);
> > > }
> > > % cc -c -Wall -pedantic-errors -O2 egcs-example.c
> > > egcs-example.c: In function `func':
> > > egcs-example.c:5: ANSI C forbids braced-groups within expressions
> > > % gcc -v
> > > Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
> > > gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
> >
> > It has to do with some interaction between -O2 optimization and tolower(),
> > it appears. Behold, for the above code:
> > $ gcc -c -Wall -pedantic-errors mtest.c
> > $ gcc -c -Wall -pedantic-errors -O2 mtest.c
> > mtest.c: In function `func':
> > mtest.c:5: ANSI C forbids braced-groups within expressions
> >
> > In short, if you drop the -O2 optimization, it compiles. At least it
> > did on my system.
>
> Yes, I know. But that really isn't a solution. I don't want to compile
> without optimisation. What I want is the bug in ecgs to be fixed.
>
> Regards,
>
> Richard....
> Old: [EMAIL PROTECTED]
> Current: [EMAIL PROTECTED]
>