lkml.org 
[lkml]   [2003]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: C99 types VS Linus types
On Mon, 07 Jul 2003, Albert Cahalan wrote:

> > Speaking of shifting forward to standards:
> >
> > unsigned char foo = 42;
> > char bar[42];
> > sprintf(bar, "%ju", (uintmax_t)foo); // see IEEE Std 1003.1-2001
> >
> > If that's too ugly, write your own [u]intmax_t-to-char[]
> > converter, then only the stack is nasty if uintmax_t is 128
> > bits wide and you're printing an array uint8_t. :-P
>
> Yes, that is too ugly. It's idealistic code.
> Readability matters more than worrying about
> something which won't happen for over 40 years,
> and won't cause Y2K-style problems even then.

sprintf doesn't lend itself too well to readibility anyways, and we have
these crutches in gcc to check argument types and all that, not to speak
of %n and other time bombs.

--
Matthias Andree
-
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 13:46    [W:0.039 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site