From patchwork Mon Jun 5 16:05:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preudhomme X-Patchwork-Id: 771316 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3whKS60crqz9s2G for ; Tue, 6 Jun 2017 02:06:13 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tl1TANma"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=K+0GwTKvjGsfVy91/ IcaFywb8n1a8ZcVbxFQNeAsX04LsJBVaTW6MmL0+zzlCsbCjZn2N7BAxOWEDXF+n pFfDpYIkXM/vtew7943mZTUskqyOP9tKFNOC2aJV+ptNv9B+2MYH3Q7Nqy9m1yTl lTlW270y9TnKxaC2+6+x8YJsBE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=3O/G4oSZf/3UYuB7riSf25m s+DM=; b=tl1TANmaBVNJb3TmUBHjP8tynZWJqrTu/NZ/EuKVKfNzdE8ZPQrWhKx M1LC+gLKK+1UT1RyC7uSqUakZwJwbZvTUjibimGUZ1ppdZ+7mggdSKLI46A5zLJV skDz2aXpmztuOPtPcvkAL+It5lzwtpbJPwfyim8jr2yxkOhBpgJE= Received: (qmail 86854 invoked by alias); 5 Jun 2017 16:06:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 86826 invoked by uid 89); 5 Jun 2017 16:05:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=la X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Jun 2017 16:05:58 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0B557344; Mon, 5 Jun 2017 09:06:00 -0700 (PDT) Received: from [10.2.206.52] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 873683F25D; Mon, 5 Jun 2017 09:05:59 -0700 (PDT) Subject: Re: [PATCH] add more detail to -Wconversion and -Woverflow (PR 80731) To: gcc-patches@gcc.gnu.org, Martin Sebor References: <315bf6c8-04e5-01ac-7278-d93c04f83b0e@gmail.com> <59319C33.70702@foss.arm.com> <1a7e78ce-1960-b9c3-feac-a24efe68af42@gmail.com> From: Thomas Preudhomme Message-ID: <749f66c3-5201-4754-d7a2-acc7248eaa9a@foss.arm.com> Date: Mon, 5 Jun 2017 17:05:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1a7e78ce-1960-b9c3-feac-a24efe68af42@gmail.com> X-IsSubscribed: yes Hi, newlib-stdint.h defines UINT32_TYPE as "long unsigned int" for ILP32 targets. This leads such target to warn on "long unsigned int" conversation rather than "unsigned int". This patch modifies the dg-warning regexp to allow an option "long " prefix in the warning, thereby working for LP64 and ILP32 targets. ChangeLog entry is as follows: *** gcc/testsuite/ChangeLog *** 2017-06-05 Thomas Preud'homme * gcc.dg/utf16-4.c: Accept "long unsigned int" as well as "unsigned int" in conversation warning on line 15. Is it ok for trunk? The dg-warning PASSes once this patch is applied. Best regards, Thomas On 04/06/17 23:54, Martin Sebor wrote: > On 06/02/2017 11:11 AM, Renlin Li wrote: >> Hi Martin, >> >> I noticed the following failures after your change r248431. >> FAIL: c-c++-common/Wfloat-conversion.c -Wc++-compat (test for >> warnings, line 42) >> FAIL: c-c++-common/Wfloat-conversion.c -Wc++-compat (test for >> warnings, line 43) >> >> It happens on arm target which is not a large_long_double target. >> The patch here add the missing target selector. After the change, those >> test >> won't checked in arm target. >> >> Here I have a simple fix to it. Okay to commit? > > r248431 wasn't meant to change when any of these warnings fire, > only their text and the amount of detail included in them. The > removal of the { target large_long_double } selector was by > accident. > > Please go ahead and commit your fix. Thanks! > >> >> gcc/testsuite/ChangeLog: >> >> 2017-06-02 Renlin Li >> >> * c-c++-common/Wfloat-conversion.c: Add large_long_double target >> selector to related line. >> >> >> >> And there is another failure: >> FAIL: gcc.dg/utf16-4.c (test for warnings, line 15) >> >> The warning message is slightly different from expected. >> utf16-4.c:10:15: warning: character constant too long for its type >> utf16-4.c:15:15: warning: conversion from 'long unsigned int' to >> 'char16_t {aka short unsigned int}' changes value from '410401' to '17185' > > The test passes for me now. The initial commit had introduced > bug 80731 but it's recently been fixed. Can you please try > again with the latest sources? > > Martin diff --git a/gcc/testsuite/gcc.dg/utf16-4.c b/gcc/testsuite/gcc.dg/utf16-4.c index f9ebd61845a15fc657a2f906d3f684768993df44..e2f115ebc813ba380718254db699db8ef96e532b 100644 --- a/gcc/testsuite/gcc.dg/utf16-4.c +++ b/gcc/testsuite/gcc.dg/utf16-4.c @@ -12,7 +12,7 @@ char16_t c2 = u'\U00064321'; /* { dg-warning "constant too long" } */ char16_t c3 = 'a'; char16_t c4 = U'a'; char16_t c5 = U'\u2029'; -char16_t c6 = U'\U00064321'; /* { dg-warning "conversion from .unsigned int. to .char16_t {aka short unsigned int}. changes value from .410401. to .17185." } */ +char16_t c6 = U'\U00064321'; /* { dg-warning "conversion from .(long )?unsigned int. to .char16_t {aka short unsigned int}. changes value from .410401. to .17185." } */ char16_t c7 = L'a'; char16_t c8 = L'\u2029'; char16_t c9 = L'\U00064321'; /* { dg-warning "conversion" "" { target { 4byte_wchar_t } } } */