From: lutz@iks-jena.de (Lutz Donnerhacke)
Subject: Re: ada vs. cpp
Date: Tue, 16 Oct 2001 10:08:56 +0000 (UTC)
Date: 2001-10-16T10:08:56+00:00 [thread overview]
Message-ID: <slrn9so1pm.hu.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: 3BCBF40A.BBDD4FE6@free.fr
* Jean-Marc Bourguet wrote:
>Lutz Donnerhacke wrote:
>> This DSP is always funny because sizeof(int[8]) == 4. This causes several
>> memory reservation problems.
>
>This is not a standard conforming implementation which requires:
>
>sizeof(char) = 1
Ack.
>sizeof(int) >= sizeof(char)
Ack. Implementation holds, because sizeof(int) == 1.
>sizeof(int[8]) = 8 * sizeof(int)
Nack. Or are packed arrays unsupported? Even, if the addressing granularity
is finer than the character size?
>so sizeof(int[8]) >= 8
No necessary.
Let's have a look at X3-J11 (C99): 6.5.3.4 The sizeof operator
: Semantics
:
:2 The sizeof operator yields the size (in bytes) of its operand, ...
:
:3 When applied to an operand that has type char, unsigned char, or signed
: char (...) the result is 1. When applied to an operant that hast array
: type, the result is the total number of bytes in the array. ...
Consequence: No compiler is a conforming one when a char is not a byte?!
And look! 3.7.1 says:
: character: single-byte character: bit representation that fits in a byte.
But oops! That's not a char.
6.2.5 says
:3 An object declared as type char is large enough to store any member of the
: basic execution character set. If a member of the basic execution set is
: stored in a char object, its value is guaranteed to be positive. If any
: other character is stored in a char object, the resulting value is
: implementation-defined but shall be within the range of values that can be
: represented in that type.
There is no reason for a byte limited character.
But 6.2.6.1 contains an interesting note:
:3 Values stored in unsigned bit-fields and objects of type unsigned char
: shall be represented using a pure binary notation. 40)
:
:4 Values stored in non-bit-field objects of any other object type consits of
: n x CHAR_BIT bits, where n is the size of an object of that type, in bytes.
: ...
:40) ... A byte contains CHAR_BIT bits ...
Ah I see: C requires (by a footnote) that Storage_Units are similar to a char.
Unfortunly this DSP addresses 32bit objects and is able to deal efficiently
with 16bit registers. An other DSP I have changes the Storage_Unit over the
address range: Starting with 8 bit bytes from 0 .. 16#f_ffff#, 16 bit bytes
from 16#10_0000# .. 16#1f_ffff#, and 32 bit bytes from 16#2f_ffff# ..
16#ffff_ffff#.
*gna*
next prev parent reply other threads:[~2001-10-16 10:08 UTC|newest]
Thread overview: 141+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-12 20:54 ada vs. cpp Richard Pinkall-Pollei
2001-10-12 21:28 ` Vector..
2001-10-13 7:07 ` Dale Stanbrough
2001-10-14 8:15 ` Jean-Marc Bourguet
2001-10-15 10:04 ` Nexus
2001-10-15 12:18 ` Lutz Donnerhacke
2001-10-15 21:25 ` Florian Weimer
2001-10-22 2:08 ` David Thompson
2001-10-22 7:04 ` Florian Weimer
2001-10-22 7:31 ` Lutz Donnerhacke
2001-11-13 2:12 ` David Thompson
2001-10-16 8:47 ` Jean-Marc Bourguet
2001-10-16 10:08 ` Lutz Donnerhacke [this message]
2001-10-16 11:07 ` Jean-Marc Bourguet
2001-10-16 12:00 ` Lutz Donnerhacke
2001-10-16 19:08 ` Darren New
2001-10-16 15:46 ` Florian Weimer
2001-10-16 19:31 ` Stephen Leake
2001-10-16 20:13 ` Florian Weimer
2001-10-16 21:42 ` Stephen Leake
2001-10-17 8:37 ` Florian Weimer
2001-10-17 8:45 ` Lutz Donnerhacke
2001-10-16 13:45 ` Ted Dennison
2001-10-16 13:54 ` Jean-Marc Bourguet
2001-10-16 13:54 ` Lutz Donnerhacke
2001-10-15 13:44 ` Marin David Condic
-- strict thread matches above, loose matches on Subject: below --
2001-10-03 20:42 Ralph M�ritz
2001-10-03 20:56 ` Preben Randhol
2001-10-03 21:07 ` Ralph M�ritz
2001-10-04 5:08 ` Pi
2001-10-04 5:07 ` Ed Falis
2001-10-04 5:13 ` David Starner
2001-10-04 10:57 ` Preben Randhol
2001-10-04 13:18 ` Marin David Condic
2001-10-04 16:30 ` Pascal Obry
2001-10-04 17:05 ` Marin David Condic
2001-10-05 15:22 ` Mike Mohr
2001-10-06 9:15 ` Pascal Obry
2001-10-06 11:23 ` MM
2001-10-06 12:27 ` Marc A. Criley
2001-10-06 16:53 ` James Rogers
2001-10-09 13:51 ` Marin David Condic
2001-10-09 14:13 ` James Rogers
2001-10-09 14:25 ` Marin David Condic
2001-10-10 16:46 ` Warren W. Gay VE3WWG
2001-10-09 15:10 ` Robert*
2001-10-09 16:17 ` James Rogers
2001-10-11 12:03 ` David Botton
2001-10-09 14:43 ` Robert*
2001-10-09 15:18 ` Wes Groleau
2001-10-09 18:21 ` Marin David Condic
2001-10-09 20:37 ` James Rogers
2001-10-09 16:21 ` James Rogers
2001-10-09 16:43 ` Lutz Donnerhacke
2001-10-10 5:18 ` Richard Riehle
2001-10-10 13:21 ` Marin David Condic
2001-10-10 14:15 ` Wes Groleau
2001-10-22 2:07 ` David Thompson
2001-10-22 13:35 ` Wes Groleau
2001-10-22 19:14 ` Ole-Hjalmar Kristensen
2001-10-23 5:40 ` Richard Riehle
2001-10-09 15:06 ` Ole-Hjalmar Kristensen
[not found] ` <9pv2f20jf4@drn.newsguy <3BC3240B.96703A8B@worldnet.att.net>
2001-10-10 5:47 ` Simon Wright
2001-10-06 22:38 ` Frode Tennebø
2001-10-06 23:48 ` mike
2001-10-07 7:31 ` Pascal Obry
2001-10-08 14:55 ` Mike Mohr
2001-10-08 15:07 ` Mike Mohr
2001-10-08 16:34 ` Robert*
2001-10-08 17:47 ` Mike Mohr
2001-10-08 18:38 ` Robert*
2001-10-09 14:56 ` Mike Mohr
2001-10-09 15:20 ` Wes Groleau
2001-10-09 16:14 ` Steven Deller
2001-10-09 16:55 ` Pascal Obry
2001-10-08 19:19 ` James Rogers
2001-10-09 8:17 ` Pascal Obry
2001-10-09 15:46 ` Ted Dennison
2001-10-09 17:35 ` Mike Mohr
2001-10-09 18:45 ` Ted Dennison
2001-10-08 18:02 ` Ted Dennison
2001-10-09 4:59 ` David Thompson
2001-10-04 13:16 ` Ted Dennison
2001-10-05 7:50 ` Dmitry Kazakov
2001-10-05 13:31 ` David Starner
2001-10-05 15:34 ` Ted Dennison
2001-10-05 17:49 ` David Starner
2001-10-05 18:54 ` Wes Groleau
2001-10-05 22:02 ` James Rogers
2001-10-05 22:35 ` Wes Groleau
2001-10-06 3:44 ` David Starner
2001-10-08 8:18 ` Dmitry Kazakov
2001-10-08 13:33 ` David Starner
2001-10-09 13:36 ` Wes Groleau
2001-10-09 15:29 ` David Starner
2001-10-10 11:01 ` Dmitry Kazakov
2001-10-10 11:20 ` Lutz Donnerhacke
2001-10-10 12:14 ` Robert*
2001-10-10 13:31 ` Lutz Donnerhacke
2001-10-10 14:36 ` Steven Deller
2001-10-10 14:59 ` Wes Groleau
2001-10-10 15:15 ` Lutz Donnerhacke
2001-10-10 15:16 ` Dmitry Kazakov
2001-10-10 16:10 ` Florian Weimer
2001-10-11 8:02 ` Dmitry Kazakov
2001-10-10 15:59 ` Brian Rogoff
2001-10-10 18:50 ` David Starner
2001-10-11 9:28 ` Lutz Donnerhacke
2001-10-10 14:03 ` David Starner
2001-10-10 16:40 ` Ted Dennison
2001-10-10 17:53 ` Pascal Obry
2001-10-10 23:11 ` David Starner
2001-10-11 3:00 ` James Rogers
2001-10-22 2:10 ` David Thompson
2001-10-05 13:52 ` James Rogers
2001-10-05 14:28 ` Larry Kilgallen
2001-10-05 14:07 ` Ted Dennison
2001-10-16 4:52 ` David Thompson
2001-10-16 10:21 ` Dmitry Kazakov
2001-11-13 2:12 ` David Thompson
2001-11-13 10:21 ` Dmitry A. Kazakov
2001-11-13 16:05 ` Ted Dennison
2001-11-14 9:29 ` Dmitry A. Kazakov
2001-10-04 6:01 ` mike
2001-10-04 8:42 ` Pi
2001-10-04 12:22 ` James Rogers
2001-10-04 16:26 ` Pascal Obry
2001-10-04 18:47 ` David Botton
2001-10-04 22:29 ` Jacob Sparre Andersen
2001-10-04 22:31 ` Wes Groleau
2001-10-04 22:52 ` Preben Randhol
2001-10-05 12:43 ` Georg Bauhaus
2001-10-05 13:09 ` Preben Randhol
2001-10-06 1:05 ` Mike Silva
2001-10-04 13:50 ` Ted Dennison
2001-10-03 21:03 ` Marin David Condic
2001-10-04 2:40 ` Jeff
2001-10-05 1:23 ` Adrian Hoe
2001-10-05 4:34 ` mike
2001-10-05 4:42 ` mike
2001-10-05 11:13 ` Adrian Hoe
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox