From: Thomas Demmer Newsgroups: comp.os.msdos.djgpp Subject: Re: Why two identical typedef are considered an error in DJGPP? Date: Tue, 28 Jan 1997 10:32:56 +0100 Organization: Lehrstuhl fuer Stroemungsmechanik Lines: 51 Message-ID: <32EDC7C8.1CFB@LSTM.Ruhr-UNI-Bochum.De> References: <01IE7MKQWZ2Q003361 AT cc DOT uab DOT es> <32e22d1c DOT 4599867 AT ursa DOT smsu DOT edu> NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Moo-Juice wrote: > > In article <32e22d1c DOT 4599867 AT ursa DOT smsu DOT edu>, Tony O'Bryan > writes > >On Sat, 18 Jan 1997 01:01:22 GMT, Dave Pearson > >wrote: > > > >>#ifndef BYTE > >>typedef unsigned char BYTE; > >>#endif > >> > >>#ifndef BYTE > >>typedef unsigned char BYTE; > >>#endif > > > >GCC complains about a redefinition, but will allow a #define in place of the > >typedef. Turbo C allows both versions. > > > >Sorry for the extra text, but Free Agent won't let me send a message that has > >more quoted material than new. :( > > One question... why are the 'chars' unsigned? This is a simple query > and not an attack on the reason for using it :) > > -- > Moo-Juice char foo; unsigned char bar; int foobar; bar=foo=0xff; /* foo is -1, bar is 255, but no problem here */ foobar = bar, /* foobar is 255, probably what you wanted */ foobar = foo; /* foobar is -1, probably not what you wanted */ -- Ciao Tom ************************************************************* * Thomas Demmer * * Lehrstuhl fuer Stroemungsmechanik * * Ruhr-Uni-Bochum * * Universitaetsstr. 150 * * D-44780 Bochum * * Tel: +49 234 700 6434 * * Fax: +49 234 709 4162 * * Voice/Fax Box: +49 2561 91371 2056 * * http://www.lstm.ruhr-uni-bochum.de/~demmer * *************************************************************