[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribut
From: |
Volker Kuhlmann |
Subject: |
Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribute__() |
Date: |
Wed, 02 Nov 2011 09:06:57 +1300 |
On Wed 02 Nov 2011 03:14:01 NZDT +1300, Joerg Wunsch wrote:
> In practice, I don't think you'll observe any different behaviour
> between an `unsigned char' and an `uint8_t' with GCC, unless
> (obviously) working on a platform that does not offer 8-bit integers
> at all (but I don't know whether such a platform exists where GCC has
> ever been ported to).
Yes it has, about 1996/97: TMS320C3x can (or could back then) physically
not address anything less than 32bit, so the implementation in gcc (like
I believe the TI one) had sizeof(char) = 1[1] = 4 bytes. Every character in
a string wasted 4 bytes - no instruction to pick a 32bit word apart.
The person who ported this (Michael Hayes) is a lecturer at the
university I was at. He said it was quite challenging to get everyone to
be aware that the common implicit assumption when writing code of
sizeof(char) = 1 byte is not valid and to get gcc and binutils to behave
themselves.
[1] As mandated by C standards.
Volker
--
Volker Kuhlmann
http://volker.dnsalias.net/ Please do not CC list postings to me.
- Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribute__(), (continued)
- Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribute__(), Joerg Wunsch, 2011/11/01
- Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribute__(), Joerg Wunsch, 2011/11/01
- Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribute__(), David Brown, 2011/11/01
- Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribute__(), Joerg Wunsch, 2011/11/01
- Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribute__(), David Brown, 2011/11/01
- Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribute__(), Joerg Wunsch, 2011/11/01
- Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribute__(),
Volker Kuhlmann <=
- Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribute__(), Georg-Johann Lay, 2011/11/01
- Re: [avr-libc-dev] [bug #34695] fixed width int types without __attribute__(), Joerg Wunsch, 2011/11/01