lkml.org 
[lkml]   [2004]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: PATCH: stdint constants
Date
Followup to:  <OF1C112AC2.560EA5F6-ONC1256F41.0049C0DE@telemotive.de>
By author: roman.fietze@telemotive.de
In newsgroup: linux.dev.kernel
>
> Hello,
>
> First of all: sorry for using Notes MUA, but cannot route to kernel.org
> due to NJABL.
>
> Allthough many books recommend using the types uint8_t to uint64_t as
> well as their signed counterparts, I could not find the MIX/MAX values
> for those types in any kernel include file.
>
> Tested on a 2.4 ARM/PPC/I386 kernel with gcc 3.0.4/3.2.2/3.3.2. Not
> tested on any 64 bit architecture.
>
> Any comments to this patch?
>

Yes. Long long is a ISO C99 type guaranteed to be at least 64 bits.
Thus,

#if defined(__GNUC__) && !defined(__STRICT_ANSI__)

is wrong; it's in fact actively harmful.

Furthermore, this should only be used by the kernel, since this comes
from <stdint.h> in userspace.

<stdint.h> really should be a compiler-provided header file. Sigh.

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

\
 
 \ /
  Last update: 2005-03-22 14:07    [W:0.032 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site