From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13306 invoked by alias); 14 Oct 2014 21:31:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 13292 invoked by uid 89); 14 Oct 2014 21:31:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f44.google.com Received: from mail-pa0-f44.google.com (HELO mail-pa0-f44.google.com) (209.85.220.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 14 Oct 2014 21:31:00 +0000 Received: by mail-pa0-f44.google.com with SMTP id et14so8665519pad.31 for ; Tue, 14 Oct 2014 14:30:58 -0700 (PDT) X-Received: by 10.68.69.16 with SMTP id a16mr4871913pbu.151.1413322258568; Tue, 14 Oct 2014 14:30:58 -0700 (PDT) Received: from [192.168.1.103] ([223.72.65.33]) by mx.google.com with ESMTPSA id pg2sm15069248pbb.43.2014.10.14.14.30.55 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 14 Oct 2014 14:30:57 -0700 (PDT) Message-ID: <543D960F.3@gmail.com> Date: Tue, 14 Oct 2014 21:31:00 -0000 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Mark Kettenis CC: gdb-patches@sourceware.org, palves@redhat.com Subject: Re: [PATCH v2] gdb/i387-tdep.c: Avoid warning for "-Werror=strict-overflow" References: <543A8208.9060605@gmail.com> <201410131516.s9DFGPh9005236@glazunov.sibelius.xs4all.nl> <543BF857.9080805@gmail.com> In-Reply-To: <543BF857.9080805@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-10/txt/msg00376.txt.bz2 On 10/14/2014 12:05 AM, Chen Gang wrote: > On 10/13/14 23:16, Mark Kettenis wrote: >>> Date: Sun, 12 Oct 2014 21:28:40 +0800 >>> From: Chen Gang >>> >>> gdb requires "-Werror", and I387_ST0_REGNUM (tdep) is 'variable', then >>> compiler can think that I387_ST0_REGNUM (tdep) may be a large number, >>> which may cause issue, so report warning. >>> >>> Need fix this warning, and still keep the code clear enough for readers. >>> The related warning under Darwin with gnu built gcc: >> >> Sorry, I disagree with this approach. I think your compiler is really >> being unhelpful here. See if a newer GCC version of the compiler >> still triggers that warning. If so, complain to the GCC people. >> > > Excuse me, I do not dare to complain it to gcc members, because for me, > the compiler's printing is obviously, and proofs itself is correct. If I > ask a quite obvious question to them, I guess, I will be complained. > > Hmm... But I may have an additional trying: Use original gcc and provide > "-Werror=strict-overflow" to see what will happen. > > - If it will report warning too, I can ask gcc members why integrate > "-Wstrict-overflow" to -Wall. > > - If it will not report warning, it means original gcc also integrate > "-Wstrict-overflow" or have no this option. And for me, I prefer to > use "#pragma GCC diagnostic ignored ... " for our code. After use "gcc version 4.8.3 20140624 (Red Hat 4.8.3-1) (GCC)" with "-Wstrict-overflow", it supports this flag, and does not report warning. For me, either "$pragma GCC diagnostic ignored ..." or continuing this patch. At present, I don't know any other ways for it. Thanks. -- Chen Gang Open share and attitude like air water and life which God blessed