On Wed, 11 Dec 2002, Muli Ben-Yehuda wrote:
> And if you can, use XDR (External Data Representation). Standard is
> always good. http://www.faqs.org/rfcs/rfc1014.html.
the problem with this specification is it is wasteful in network
resources, because it uses a lot of padding for small data ty
man gcc gives :
--
-fshort-enums
Allocate to an enum type only as many bytes as it
needs for the declared range of possible values.
Specifically, the enum type will be equivalen
Guy Baruch <[EMAIL PROTECTED]> writes:
> redefine as:
>
> enum bool {FALSE; TRUE};
I don't think you can do that with bool, which is a reserved word in
C++. You will need
#define bool mybool
or equivalent first, which is, well...
> then compile with
>
> gcc -fshort-enums
s/gcc/g++/
> (whi
Quoting Guy Baruch <[EMAIL PROTECTED]>:
> redefine as:
>
> enum bool {FALSE; TRUE};
>
> then compile with
>
> gcc -fshort-enums
>
> (which will make _all_ your enums short => non-alligned.)
I'm pretty sure that you're mistaken. My PPC box is at home so I can't test
this, but I'm pretty sure t
redefine as:
enum bool {FALSE; TRUE};
then compile with
gcc -fshort-enums
(which will make _all_ your enums short => non-alligned.)
Michael Sternberg wrote:
I'm wondering why sizeof(bool) is 1 byte in Intel platform and 4 bytes on
PPC ? Is it depends on version of gcc (2.95.3 on Int
On Wed, Dec 11, 2002 at 11:31:08AM +0200, [EMAIL PROTECTED] wrote:
> If Michael's intention is to use the struct to transfer information from one
> architecture to the other, then you're absolutely right. Endianity is the
> *first* thing to consider - Motorola is always the reverse of Intel. To tr
Quoting Gilad Ben-Yossef <[EMAIL PROTECTED]>:
[snip]
> But now let's do it back wards - assign the value of IA32 and test for
> it on PPC. On IA32 we put NULL in *first* of the bytes and leave junk in
> the other 3 padding bytes. On the PPC we then test whether these *four*
> bytes are zero. Bec
On Wed, 2002-12-11 at 11:31, [EMAIL PROTECTED] wrote:
> > But now let's do it back wards - assign the value of IA32 and test for
> > it on PPC. On IA32 we put NULL in *first* of the bytes and leave junk in
> > the other 3 padding bytes. On the PPC we then test whether these *four*
> > bytes are zer
Michael Sternberg <[EMAIL PROTECTED]> writes:
> I'm wondering why sizeof(bool) is 1 byte in Intel platform and 4 bytes on
> PPC ? Is it depends on version of gcc (2.95.3 on Intel, 2.96 on PPC)
> ? Can I somehow (some compiler flag) make them of same size ?
No. At the very l
On Wed, 2002-12-11 at 10:24, Michael Sternberg wrote:
>
> Gilad Ben-Yossef wrote:
> > Furthermore, relying on 'int', 'bool' and friends to be ANY specific
> > size is bad and broken programing and will prevent you to port the
> > program to other ARCHs even with the same compiler etc.
>
> While I
Gilad Ben-Yossef wrote:
> Furthermore, relying on 'int', 'bool' and friends to be ANY specific
> size is bad and broken programing and will prevent you to port the
> program to other ARCHs even with the same compiler etc.
While I agree with Gilad, just as service to public here is solution:
stru
On Wed, Dec 11, 2002 at 07:40:35AM +, Michael Sternberg wrote:
>
> I'm wondering why sizeof(bool) is 1 byte in Intel platform and 4 bytes on
> PPC ?
My guess is alignment.
> Is it depends on version of gcc (2.95.3 on Intel, 2.96 on PPC) ?
Certainly might be, although it
On Wed, 2002-12-11 at 09:40, Michael Sternberg wrote:
>
> I'm wondering why sizeof(bool) is 1 byte in Intel platform and 4 bytes on
> PPC ? Is it depends on version of gcc (2.95.3 on Intel, 2.96 on PPC) ?
> Can I somehow (some compiler flag) make them of same size ?
>
Th
Quoting Michael Sternberg <[EMAIL PROTECTED]>:
>
> I'm wondering why sizeof(bool) is 1 byte in Intel platform and 4 bytes on
> PPC ? Is it depends on version of gcc (2.95.3 on Intel, 2.96 on PPC) ?
> Can I somehow (some compiler flag) make them of same size ?
Just an e
I'm wondering why sizeof(bool) is 1 byte in Intel platform and 4 bytes on
PPC ? Is it depends on version of gcc (2.95.3 on Intel, 2.96 on PPC) ?
Can I somehow (some compiler flag) make them of same size ?
=
To unsubscribe,
15 matches
Mail list logo