Re: time_t size: The year 2038 bug?

From: Jakub Jelinek (jakub@redhat.com)
Date: Fri Jan 07 2000 - 04:32:49 EST


On Thu, Jan 06, 2000 at 08:53:23PM -0500, Johan Kullstam wrote:
> Thierry Vignaud <tvignaud@mandrakesoft.com> writes:
>
> > Jesse Pollard a écrit :
> > >
> > > Johan Kullstam" <kullstam@ne.mediaone.net>
> > > >i'd also like to see C types with *specified* bit widths, e.g.,
> > > >int16, int32, uint8 &c. then you could write more portable code when
> > > >you really need a certain number of bits like for CRC algorithms.
> >
> > ever head of inttypes.h ???
>
> consider a 64 bit processor where you'd like to have 64 bit integers.
> use the following:
>
> type bits
> char 8
> short int 16
> int 64
> long int 64
> long long 128
>
> ok now that we have no 32 bit integer quantity, please get me a 32 bit
> integer using a #define macro.

Its up to stdint.h to provide you correct typedefs for int8_t, int16_t,
int32_t, int64_t. E.g. with gcc, it is easy,
e.g. on archs with char type 8bit large with
typedef int int32_t __attribute__((mode (SI)));
even if int is 64bit as well as long,
and I think other compilers have their ways of doing something similar as
well.
128bit long long is very uncommon these days on the other side, even on
64bit architectures.

Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.36 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jan 07 2000 - 21:00:08 EST