This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] gdb/microblaze-tdep.c: Check whether less than zero in conditional expression
- From: Chen Gang <gang dot chen dot 5i5j at gmail dot com>
- To: Michael Eager <eager at eagerm dot com>
- Cc: eager at eagercon dot com, binutils at sourceware dot org, gdb-patches at sourceware dot org
- Date: Fri, 01 Aug 2014 02:55:35 +0800
- Subject: Re: [PATCH] gdb/microblaze-tdep.c: Check whether less than zero in conditional expression
- Authentication-results: sourceware.org; auth=none
- References: <53CBCC2F dot 7040702 at gmail dot com> <53D01542 dot 9020107 at eagerm dot com> <53D031E7 dot 40602 at gmail dot com>
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):
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
`-Wall' turns on the following warning flags:
-Warray-bounds (only with `-O2')
-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)
-Wmain (only for C/ObjC and unless `-ffreestanding')
-Wsign-compare (only in C++)
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.
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.)
-Wmissing-parameter-type (C only)
-Wold-style-declaration (C only)
-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
* A pointer is compared against integer zero with `<', `<=',
`>', or `>='.
* (C++ only) An enumerator and a non-enumerator both appear in a
* (C++ only) Ambiguous virtual bases.
* (C++ only) Subscripting an array that has been declared
* (C++ only) Taking the address of a variable that has been
* (C++ only) A base class is not initialized in a derived
class' copy constructor.
Open share and attitude like air water and life which God blessed