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

Bug#162612: libc6-dev: telling gcc to optimize causes C99 violations, thanks to endian.h



On Fri, Sep 27, 2002 at 02:05:53PM -0400, Ben Collins wrote:
> > $ gcc-3.2 -c -o twofish.o -O1 -g twofish.c
> > twofish.c:214:1: warning: "BIG_ENDIAN" redefined
> > In file included from /usr/include/bits/string2.h:52,
> >                  from /usr/include/string.h:360,
> >                  from /usr/include/memory.h:30,
> >                  from twofish.c:156:
> > /usr/include/endian.h:47:1: warning: this is the location of the previous
> > definition
> 
> One thing I want to note is that if you need strict c99, then you should
> add this to cflags: --std=c99 -D_ISOC99_SOURCE
> 
> The --std=c99 tells the compiler to be strictly c99 conforming, and the
> _ISOC99_SOURCE tells glibc to also be such.
> 
> You should retest with that.
> 
> Second of all, BIG_ENDIAN is only defined if __USE_BSD is defined. It's
> likely that somewhere, either _BSD_SOURCE or _GNU_SOURCE is defined.

Neither is the case.  The source file is twofish.c; you can get it at:

http://www.macfergus.com/niels/code/TwofishClib-v0.2.zip

Unzip the archive and compile it like this:

gcc -c -o twofish.o -O2 -g twofish.c

contrast with

gcc -c -o twofish.o -g twofish.c

-- 
G. Branden Robinson                |       Convictions are more dangerous
Debian GNU/Linux                   |       enemies of truth than lies.
branden@debian.org                 |       -- Friedrich Nietzsche
http://people.debian.org/~branden/ |

Attachment: pgpMxTWuJG3Br.pgp
Description: PGP signature


Reply to: