public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/38370]  New: inconsistent warnings
@ 2008-12-02 10:25 doko at ubuntu dot com
  2008-12-02 12:14 ` [Bug other/38370] " rguenth at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: doko at ubuntu dot com @ 2008-12-02 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

[forwarded from https://launchpad.net/bugs/291780]

When compiling a small test program, the compiler shows a warning I would
either not expect at all, or expect it to appear for all four if-statements
used in my example:

$ gcc -Wextra -c promotion.c
promotion.c: In function ‘main’:
promotion.c:10: warning: comparison of promoted ~unsigned with unsigned

promotion.c:
typedef unsigned char uint8_t;

int main(void)
{
        uint8_t a = 0;
        uint8_t b = 0;
        unsigned char c = 0;
        unsigned char d = 0;

        if (a == (b ^ 0xff)) { }
        if (a == (d ^ 0xff)) { }
        if (c == (b ^ 0xff)) { }
        if (c == (d ^ 0xff)) { }

        return 0;
}


-- 
           Summary: inconsistent warnings
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: doko at ubuntu dot com


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


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

* [Bug other/38370] inconsistent warnings
  2008-12-02 10:25 [Bug other/38370] New: inconsistent warnings doko at ubuntu dot com
@ 2008-12-02 12:14 ` rguenth at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-12-02 12:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2008-12-02 12:12 -------


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


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-12-02 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-02 10:25 [Bug other/38370] New: inconsistent warnings doko at ubuntu dot com
2008-12-02 12:14 ` [Bug other/38370] " rguenth 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).