From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21941 invoked by alias); 7 Feb 2014 21:20:15 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 21924 invoked by uid 48); 7 Feb 2014 21:20:11 -0000 From: "chengniansun at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/60083] Duplicate conversion warnings from negative integer to unsigned type (gcc-4.3 emits only one warning) Date: Fri, 07 Feb 2014 21:20:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chengniansun at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg00753.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D60083 --- Comment #1 from Chengnian Sun --- I think the following case is similar to the reported case. The only differ= ence is the message content. The following case also triggers "gcc -O0" to emit = two duplicate warnings. But "gcc -O1" emits only one warning. $: cat s.c extern short fn2(short, short); unsigned long g; void fn1() { int const l =3D 0; fn2(((g =3D l !=3D 0) < 10LL) | 91608LL, 0); } $: gcc-trunk -c -Wconversion -std=3Dc99 s.c s.c: In function =E2=80=98fn1=E2=80=99: s.c:5:7: warning: conversion to =E2=80=98short int=E2=80=99 alters =E2=80= =98long long int=E2=80=99 constant value [-Wconversion] fn2(((g =3D l !=3D 0) < 10LL) | 91608LL, 0); ^ s.c:5:7: warning: conversion to =E2=80=98short int=E2=80=99 alters =E2=80= =98long long int=E2=80=99 constant value [-Wconversion] $: gcc-trunk -c -Wconversion -std=3Dc99 s.c -O1 s.c: In function =E2=80=98fn1=E2=80=99: s.c:5:7: warning: conversion to =E2=80=98short int=E2=80=99 from =E2=80=98l= ong long int=E2=80=99 may alter its value [-Wconversion] fn2(((g =3D l !=3D 0) < 10LL) | 91608LL, 0); ^ $: >>From gcc-bugs-return-442997-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Feb 07 21:22:00 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 24367 invoked by alias); 7 Feb 2014 21:22:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 24343 invoked by uid 48); 7 Feb 2014 21:21:56 -0000 From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/60083] Duplicate conversion warnings from negative integer to unsigned type (gcc-4.3 emits only one warning) Date: Fri, 07 Feb 2014 21:22:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg00754.txt.bz2 Content-length: 589 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60083 Marek Polacek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-02-07 CC| |mpolacek at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #2 from Marek Polacek --- Yeah, I bet we'll have tons of those ;/.