Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422806AbXBIAXO (ORCPT ); Thu, 8 Feb 2007 19:23:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1422967AbXBIAXN (ORCPT ); Thu, 8 Feb 2007 19:23:13 -0500 Received: from smtp.osdl.org ([65.172.181.24]:46822 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422806AbXBIAXM (ORCPT ); Thu, 8 Feb 2007 19:23:12 -0500 Date: Thu, 8 Feb 2007 16:22:59 -0800 (PST) From: Linus Torvalds To: =?ISO-8859-1?Q?J=2EA=2E_Magall=C3=B3n?= cc: Jan Engelhardt , Jeff Garzik , Linux Kernel Mailing List , Andrew Morton Subject: Re: somebody dropped a (warning) bomb In-Reply-To: <20070209010317.3c442240@werewolf-wl> Message-ID: References: <45CB3B28.60102@garzik.org> <20070208221317.5beedaeb@werewolf-wl> <20070209010317.3c442240@werewolf-wl> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463790079-1135479423-1170980579=:8424" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1812 Lines: 51 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463790079-1135479423-1170980579=:8424 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT On Fri, 9 Feb 2007, J.A. Magallón wrote: > > Thats the point. Mmmm, I think I see it the other way around. I defined > a variable as 'signed' or 'unsigned', because the sign info matters for me. > And gcc warns about using a function on it that will _ignore_ or even > misinterpret that info. Could it be a BUG ? Yes. Sure. The other way of seeing it is that *anything* could be a bug. Could adding 1 to "a" be a bug? Yes. "a" might overflow. So maybe the compiler should warn about that too? So do you think a compiler should warn when you do int a = i + 1; and say "warning: Expression on line x might overflow"? Could it be a BUG? Hell yeah. Is warning for things that _could_ be bugs sane? Hell NO. > Linux/x86, gcc 4.1.2-0.20070115: > werewolf:~> gcc -Wpointer-sign -c t.c > t.c: In function ??f??: > t.c:10: warning: pointer targets in passing argument 1 of ??strlen?? differ in signedness > t.c:11: warning: pointer targets in passing argument 1 of ??strlen?? differ in signedness Yeah, and that's what I think is crazy. Is it consistent? Yes. Does it help people? No. A warning that is consistent is not necessarily a good warning. It needs to MAKE SENSE too. And this one doesn't. I'm sorry if you can't see that. Linus ---1463790079-1135479423-1170980579=:8424-- - 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/