X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f Date: Thu, 27 Dec 2001 10:38:10 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Tim Van Holder cc: djgpp-workers AT delorie DOT com Subject: Re: gcc 3.03 and libc sources In-Reply-To: <000701c18e67$72043aa0$cef8e0d5@zastaixp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 27 Dec 2001, Tim Van Holder wrote: > In any case, this is the code that decides to emit the warning: > > [c-typeck.c, around line 3525] > /* If -Wsign-compare, warn here if type1 and type2 have > different signedness. We'll promote the signed to unsigned > and later code won't know it used to be different. > Do this check on the original types, so that explicit casts > will be considered, but default promotions won't. */ Thanks for looking this up. I don't consider myself a C language lawyer, but it sounds like a bug: why does GCC have to promote to unsigned in the case of the ?: expression. That is only true in the case of "op1 RELOP op2" expression, where RELOP is ==, =>, etc. It's possible that GCC mistakenly grafts the ?: operator into the same condition, when it shouldn't. Would someone please post a message to the GCC list? > The only potential issue seems to be that the promotions involved may > turn the return type into something that might be undesirable. There's no promotion involved in ?:, at least there shouldn't be a promotion.