delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/28/07:26:09

From: Thomas Demmer <demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De>
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>
<Pine DOT A41 DOT 3 DOT 94 DOT 970115082052 DOT 92882A-100000 AT acs2 DOT acs DOT ucalgary DOT ca>
<jRKDPBAXkX3yEw9J AT foobar DOT co DOT uk> <slrn5e086r DOT gp5 DOT davep AT hagbard DOT demon DOT co DOT uk>
<32e22d1c DOT 4599867 AT ursa DOT smsu DOT edu> <dzL7mEAPMf5yEwI6 AT flag DOT demon DOT co DOT uk>
NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de
Mime-Version: 1.0
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
> <aho450s AT nic DOT smsu DOT edu> writes
> >On Sat, 18 Jan 1997 01:01:22 GMT, Dave Pearson <davep AT hagbard DOT demon DOT co DOT uk>
> >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                *
*************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019