From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8566 invoked by alias); 17 Jan 2007 12:32:41 -0000 Received: (qmail 8397 invoked by uid 48); 17 Jan 2007 12:32:24 -0000 Date: Wed, 17 Jan 2007 12:32:00 -0000 Message-ID: <20070117123224.8396.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/11856] unsigned warning in template In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tromey at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-01/txt/msg01344.txt.bz2 ------- Comment #20 from tromey at gcc dot gnu dot org 2007-01-17 12:32 ------- > The particularity of such expressions is that they are constants. I've thought about this a bit but I don't have a real conclusion. I don't know why this warning was added in the first place... it seems like perhaps it was to deal with comparisons against constants. For instance comparing "unsigned < 0" or what have you. If this is the case (and we'd have to dig a bit to find out) then that would seem to argue against this approach. My interest here is template-oriented... I consider it from a generic programming point of view. I was trying to write a certain program in the generic style, and one particular template instantiation yielded a warning. One possible idea would be an expression attriute of some kind: __do_not_warn__ (val < 0) I'm not extremely happy with this however. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11856