------- 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