[gull] Subtilité de C n° 2 : type de retour de malloc

Daniel Cordey dc at mjt.ch
Wed Apr 2 18:33:46 CEST 2008


On Wednesday 02 April 2008, Daniel Cordey wrote:
> On Wednesday 02 April 2008, Leopoldo Ghielmetti wrote:
> > Merci, merci!
>
> APres de tres breves recherches, je n'ai trouve que ceci qui est defini par
> LSB 1.3. Je n'ai trouve que les references a IA64 mais pas celle
> specifiques a l'architecture x86...

ET j'ai trouve ceci :

 The ISO/IEC 9899:1990 standard specified that the language should support 
four signed and unsigned integer data types- char, short, int, and long- but 
placed very little requirement on their size other than that int and short be 
at least 16 bits and long be at least as long as int and not smaller than 32 
bits. For 16-bit systems, most implementations assigned 8, 16, 16, and 32 
bits to char, short, int, and long, respectively. For 32-bit systems, the 
common practice has been to assign 8, 16, 32, and 32 bits to these types. 
This difference in int size can create some problems for users who migrate 
from one system to another which assigns different sizes to integer types, 
because the ISO C standard integer promotion rule can produce silent changes 
unexpectedly. The need for defining an extended integer type increased with 
the introduction of 64-bit systems. 

sur la page : 

http://pwet.fr/man/linux/conventions/posix/inttypes_h

Le standard ISO/IEC 9899 ne specifie donc pas la taille en bytes pour 
les "*integer data types" (...but placed very little requirement on their 
size...)

dc




More information about the gull mailing list