public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/20550] New: Silencing the warning: comparison is always true due to limited range of data type
@ 2005-03-19 10:51 qrczak at knm dot org dot pl
  2005-03-19 12:14 ` [Bug c/20550] " joseph at codesourcery dot com
  2005-03-20 17:50 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: qrczak at knm dot org dot pl @ 2005-03-19 10:51 UTC (permalink / raw)
  To: gcc-bugs

It would be nice if the warning "comparison is always true due to limited range
of data type" could be turned off. From looking at the gcc source I conclude it
can't. I couldn't find a workaround which generates the same code (casting the
smaller type to the wider type just for the comparison doesn't silence the
warning, using a wider type for the variable generates worse code).

Yet better if it could be turned off locally. I know which comparisons in my C
macro may trigger it, and it would make sense to turn it off only in these places.

-- 
           Summary: Silencing the warning: comparison is always true due to
                    limited range of data type
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: qrczak at knm dot org dot pl
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c/20550] Silencing the warning: comparison is always true due to limited range of data type
  2005-03-19 10:51 [Bug c/20550] New: Silencing the warning: comparison is always true due to limited range of data type qrczak at knm dot org dot pl
@ 2005-03-19 12:14 ` joseph at codesourcery dot com
  2005-03-20 17:50 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: joseph at codesourcery dot com @ 2005-03-19 12:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From joseph at codesourcery dot com  2005-03-19 12:02 -------
Subject: Re:  New: Silencing the warning: comparison is always
 true due to limited range of data type

On Sat, 19 Mar 2005, qrczak at knm dot org dot pl wrote:

> It would be nice if the warning "comparison is always true due to limited range
> of data type" could be turned off. From looking at the gcc source I conclude it
> can't. I couldn't find a workaround which generates the same code (casting the
> smaller type to the wider type just for the comparison doesn't silence the
> warning, using a wider type for the variable generates worse code).

I've suggesting moving this warning to an option -Wcomparison-fixed, not 
on by default and not in -Wall but included in -Wextra.  See bug 12963.



-- 


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


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

* [Bug c/20550] Silencing the warning: comparison is always true due to limited range of data type
  2005-03-19 10:51 [Bug c/20550] New: Silencing the warning: comparison is always true due to limited range of data type qrczak at knm dot org dot pl
  2005-03-19 12:14 ` [Bug c/20550] " joseph at codesourcery dot com
@ 2005-03-20 17:50 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-20 17:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-20 17:50 -------


*** This bug has been marked as a duplicate of 12963 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2005-03-20 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-19 10:51 [Bug c/20550] New: Silencing the warning: comparison is always true due to limited range of data type qrczak at knm dot org dot pl
2005-03-19 12:14 ` [Bug c/20550] " joseph at codesourcery dot com
2005-03-20 17:50 ` pinskia at gcc dot gnu dot org

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