lkml.org 
[lkml]   [2003]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] s390 (7/13): gcc 3.3 adaptions.

On Tue, 25 Feb 2003, Linus Torvalds wrote:
>
> return x[1][-1];

Btw, don't get me wrong. I don't think the above is really code that
should survive, and if the compiler were to generate a warning for
something like that, where the subscripts are clearly out of the range
that they were in the declaration, then I'd be entirely supportive of
that.

I don't know how we got side-tracked to negative subscripts. They are
clearly legal with pointers, but that wasn't even the issue: the code that
generated the "signed/unsigned" warning didn't use any negative
subscripts, never had, and never will.

And unlike the abomination above, the code that generates the warning is
the _clearest_ version of code you can humanly write. And THAT is the
problem with the warning: there's no way to avoid the warning without
making the source code _worse_ in some way.

And _that_ is what my argument really boils down to. Nothing else.

Linus

-
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:33    [W:0.064 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site