avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] New GCC warning - how to silence?


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] New GCC warning - how to silence?
Date: Sat, 7 Apr 2007 00:47:05 +0200
User-agent: Mutt/1.5.11

As Eric Weddington wrote:

> The makefile explicitly compiles with -funsigned-chars

Which just doesn't matter at all.

> , yet this
> produces a warning.

Sure.  It's a deficiency of the old compiler to *not* have produced
that warning.

> Note that the issue seems to be when it is a pointer to
> a char.

Which has, according to the standard, undefined signedness.

> I would think that when -funsigned-char is used, a pointer to a char
> would be equivalent to a pointer to an unsigned char.

The issue is, any implementation will always have to implement it as
either

unsigned char == char != signed char

or

unsigned char != char == signed char.

Yet, as the default signedness of char is not defined by the standard,
any *portable* application has to be written as if

unsigned char != char != signed char

That's the entire point the warning is about, and that's why neither
your compile-time option nor your suggested change to the compiler's
default behaviour would avoid the warning.  Nor would they fix the
broken (in terms of portability) application.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]