Fails to spot logical error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Using '6 2017-q2-update' and '6 2017-q1-update' from the ARM web site.
The following code from a library does not cause a warning with the '-Wlogical-op' warning option:-
tmp = (DEVINFO-
>> _DEVINFO_
Note the use of && instead of &.
The same code using GCC 4.9.3 supplied in the Ubuntu 16.04 package manager (i.e. 'arm-none-eabi-gcc (15:4.9.
em_vdac.c:197:35: warning: logical 'and' applied to non-boolean constant [-Wlogical-op]
The x86 version of GCC 5.4.0 also works correctly.
Its really a GCC problem, but it is worth pointing out since when it works this option is very useful.
Hi Mike,
Could you provide us with a standalone preprocessed testcase? Compiling with -save-temps and sending us the .i (or .ii if this is a C++ code) file would do this. Please also give the full command-line you used for compiling that testcase.
Best regards.