------- Comment #21 from gdr at cs dot tamu dot edu 2007-01-17 13:47 ------- Subject: Re: unsigned warning in template
"tromey at gcc dot gnu dot org" <[EMAIL PROTECTED]> writes: | > 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. I see what you mean. Let me think about it. | 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. neither am I. We have introduced a warning, the usefulness of which is questionable in this specific case; now, we would be forced to used non-standard constructs to get out of that questionable warning. Something must be wrong :-) -- Gaby -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11856