lkml.org 
[lkml]   [2007]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: somebody dropped a (warning) bomb
On Thu, 8 Feb 2007 11:53:38 -0800 (PST), Linus Torvalds <torvalds@linux-foundation.org> wrote:

>
>
> On Thu, 8 Feb 2007, Jan Engelhardt wrote:
> >
> > I generally have to agree with you about the unsigned char* vs char*. It
> > is a problem of the C language that char can be signed and unsigned, and
> > that people, as a result, have used it for storing
> > "shorter_than_short_t"s.
> >
> > What C needs is a distinction between char and int8_t, rendering "char"
> > an unsigned at all times basically and making "unsigned char" and
> > "signed char" illegal types in turn.
>
> No, it's really more fundamental than that.
>
> Exactly because "char *" doesn't have a defined sign, only a TOTALLY
> INCOMPETENT compiler will warn about its signedness.
>

Perhaps the problem is that gcc warns you something like 'if you care
anything about the sign behaviour of what you send to strlen() you're doomed'.
Ie, you declared the var unsigned, so you care about it. But I can do
anything without any regard to the sign.

--
J.A. Magallon <jamagallon()ono!com> \ Software is like sex:
\ It's better when it's free
Mandriva Linux release 2007.1 (Cooker) for i586
Linux 2.6.19-jam06 (gcc 4.1.2 20070115 (prerelease) (4.1.2-0.20070115.1mdv2007.1)) #1 SMP PREEMPT
-
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: 2007-02-08 22:17    [W:0.186 / U:0.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site