public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/23608] New: -Wsign-compare and const propagation
@ 2005-08-29  2:34 br1 at internet dot com dot uy
  2005-08-29  2:57 ` [Bug c++/23608] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: br1 at internet dot com dot uy @ 2005-08-29  2:34 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

Compiling

#define FIVE 5

int main()
{
    int i = 5;
    int const ic = 5;

    i < 5u;
    ic < 5u;
    FIVE < 5u; // line 10
}


with -Wsign-compare produces the output

pp.cpp:8: warning: comparison between signed and unsigned integer expressions
pp.cpp:9: warning: comparison between signed and unsigned integer expressions


MSVC only warns on line 8.  G++'s current behaviour is unfortunate because it 
favors #defines over consts.

Regards,
Bruno Martínez

-- 
           Summary: -Wsign-compare and const propagation
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: br1 at internet dot com dot uy
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23608


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-08-30  0:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-29  2:34 [Bug c++/23608] New: -Wsign-compare and const propagation br1 at internet dot com dot uy
2005-08-29  2:57 ` [Bug c++/23608] " pinskia at gcc dot gnu dot org
2005-08-29 22:50 ` br1 at internet dot com dot uy
2005-08-29 23:01   ` Andrew Pinski
2005-08-29 23:10 ` pinskia at physics dot uc dot edu
2005-08-29 23:19 ` bangerth at dealii dot org
2005-08-30  0:11 ` br1 at internet dot com dot uy
2005-08-30  0:35 ` gdr at integrable-solutions dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).