delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/09/28/05:31:37

From: abx AT abx DOT art DOT pl (Wlodzimierz ABX Skiba)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: cleaning source from warnings troubles
Date: 28 Sep 2002 02:20:57 -0700
Organization: http://groups.google.com/
Lines: 28
Message-ID: <e8982227.0209280120.10210faa@posting.google.com>
References: <e8982227 DOT 0209230144 DOT 2d26793e AT posting DOT google DOT com> <ammsir$l1m$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <e8982227 DOT 0209270013 DOT 38800e2f AT posting DOT google DOT com> <an16kp$mgq$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: 62.21.99.104
X-Trace: posting.google.com 1033204857 22431 127.0.0.1 (28 Sep 2002 09:20:57 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: 28 Sep 2002 09:20:57 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> wrote in message news:<an16kp$mgq$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>...
> > > > 1. "aggregate has a partly bracketed initializer"
> 
> Hmm.. yes, on second look, I think I see what this is about.  You have
> a an array of structs, where the struct's only element is an array.
> Strictly speaking that's two aggregates inside each other, so you
> would need *two* pairs of {} per struct.

Yes, this fix works fine. Thanks. But second fix ...

> > Any other way to write this part as more portable code ?
> 
> Yet another enum, or a special macro to take 4 chars and transform them
> into an int, which I think the coders were assuming this code would do
> for them:
> 
> 	#define FOURCHARS_TO_INT(c1,c2,c3,c4) \
>             (((unsigned long) c1 << 24)       \
>              || ((unsigned long) c2 << 16)    \
>              || ((unsigned long) c3 << 8)     \
> 	     || (unsigned long) c4)

... not works. Or rather works where it is applied - in enum there is
no more warning. But in case statement where entries from enum are
used there is error that tokens from enum have the same value. Any
idea ?

ABX

- Raw text -


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