"Roman Mashak" <mrv@tusur.ruwr ote in message
news:g1m4gu$vf7 $1@relay.tomsk. ru...
Hello,
>
I came across this method of checking the sizes:
>
static union
{
char int8_t_incorrec t[sizeof( int8_t) == 1];
char uint8_t_incorre ct[sizeof( uint8_t) == 1];
>
char int16_t_incorre ct[sizeof( int16_t) == 2];
char uint16_t_incorr ect[sizeof(uint16_t ) == 2];
>
char int32_t_incorre ct[sizeof( int32_t) == 4];
char uint32_t_incorr ect[sizeof(uint32_t ) == 4];
>
};
>
I came across this method of checking the sizes:
>
static union
{
char int8_t_incorrec t[sizeof( int8_t) == 1];
char uint8_t_incorre ct[sizeof( uint8_t) == 1];
>
char int16_t_incorre ct[sizeof( int16_t) == 2];
char uint16_t_incorr ect[sizeof(uint16_t ) == 2];
>
char int32_t_incorre ct[sizeof( int32_t) == 4];
char uint32_t_incorr ect[sizeof(uint32_t ) == 4];
>
};
Its better to report failure case as -1, not 0.
[...]