From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11486 invoked by alias); 31 Jul 2014 18:55:51 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 11468 invoked by uid 89); 31 Jul 2014 18:55:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-pa0-f51.google.com Received: from mail-pa0-f51.google.com (HELO mail-pa0-f51.google.com) (209.85.220.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 31 Jul 2014 18:55:49 +0000 Received: by mail-pa0-f51.google.com with SMTP id ey11so4182883pad.38 for ; Thu, 31 Jul 2014 11:55:48 -0700 (PDT) X-Received: by 10.68.239.201 with SMTP id vu9mr122896pbc.35.1406832948134; Thu, 31 Jul 2014 11:55:48 -0700 (PDT) Received: from [192.168.1.102] ([223.72.65.58]) by mx.google.com with ESMTPSA id bc4sm6298080pbb.2.2014.07.31.11.55.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 31 Jul 2014 11:55:47 -0700 (PDT) Message-ID: <53DA9127.5040307@gmail.com> Date: Thu, 31 Jul 2014 18:55: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: Michael Eager CC: eager@eagercon.com, binutils@sourceware.org, gdb-patches@sourceware.org Subject: Re: [PATCH] gdb/microblaze-tdep.c: Check whether less than zero in conditional expression References: <53CBCC2F.7040702@gmail.com> <53D01542.9020107@eagerm.com> <53D031E7.40602@gmail.com> In-Reply-To: <53D031E7.40602@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00233.txt.bz2 On 07/24/2014 06:06 AM, Chen Gang wrote: > >> > I do not see this error message in my build which uses -Wall. >> > What is your build environment? Which version of GCC? >> > > Originally, I use "CFLAGS=-W -g -O2" pass to configure. And '-W' is > different from '-Wall'. '-W' reports real 'all' warnings which can be > found by compiler, but '-Wall' reports most valuable warnings. Sorry, after check details ("info gcc" in Chapter "Warning Options"), What I said is incorrect. I list the related contents below (-W means -Wextra, it can be used together with -Wall): `-Wall' This enables all the warnings about constructions that some users consider questionable, and that are easy to avoid (or modify to prevent the warning), even in conjunction with macros. This also enables some language-specific warnings described in *note C++ Dialect Options:: and *note Objective-C and Objective-C++ Dialect Options::. `-Wall' turns on the following warning flags: -Waddress -Warray-bounds (only with `-O2') -Wc++11-compat -Wchar-subscripts -Wenum-compare (in C/Objc; this is on by default in C++) -Wimplicit-int (C and Objective-C only) -Wimplicit-function-declaration (C and Objective-C only) -Wcomment -Wformat -Wmain (only for C/ObjC and unless `-ffreestanding') -Wmaybe-uninitialized -Wmissing-braces -Wnonnull -Wparentheses -Wpointer-sign -Wreorder -Wreturn-type -Wsequence-point -Wsign-compare (only in C++) -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wvolatile-register-var Note that some warning flags are not implied by `-Wall'. Some of them warn about constructions that users generally do not consider questionable, but which occasionally you might wish to check for; others warn about constructions that are necessary or hard to avoid in some cases, and there is no simple way to modify the code to suppress the warning. Some of them are enabled by `-Wextra' but many of them must be enabled individually. `-Wextra' This enables some extra warning flags that are not enabled by `-Wall'. (This option used to be called `-W'. The older name is still supported, but the newer name is more descriptive.) -Wclobbered -Wempty-body -Wignored-qualifiers -Wmissing-field-initializers -Wmissing-parameter-type (C only) -Wold-style-declaration (C only) -Woverride-init -Wsign-compare -Wtype-limits -Wuninitialized -Wunused-parameter (only with `-Wunused' or `-Wall') -Wunused-but-set-parameter (only with `-Wunused' or `-Wall') The option `-Wextra' also prints warning messages for the following cases: * A pointer is compared against integer zero with `<', `<=', `>', or `>='. * (C++ only) An enumerator and a non-enumerator both appear in a conditional expression. * (C++ only) Ambiguous virtual bases. * (C++ only) Subscripting an array that has been declared `register'. * (C++ only) Taking the address of a variable that has been declared `register'. * (C++ only) A base class is not initialized in a derived class' copy constructor. Thanks. -- Chen Gang Open share and attitude like air water and life which God blessed