[dpdk-dev] [PATCH] e1000/base: Add missing braces to the 'if' statements

Markos Chandras mchandras at suse.de
Mon Jun 27 17:47:08 CEST 2016


Hi Bruce,

On 06/27/2016 03:39 PM, Bruce Richardson wrote:
> On Thu, Jun 23, 2016 at 10:25:52AM +0100, Markos Chandras wrote:
>> Add the missing braces to the 'if' statements to fix the misleading
>> identation. This also fixes the following build errors when building
>> with gcc >= 6:
>>
>> drivers/net/e1000/base/e1000_phy.c:4156:2:
>> error: this 'if' clause does not guard... [-Werror=misleading-indentation]
>> if (locked)
>> ^~
>>
>> drivers/net/e1000/base/e1000_phy.c:4158:3:
>> note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
>> if (!ready)
>> ^~
>>
>> drivers/net/e1000/base/e1000_phy.c: In function 'e1000_write_phy_reg_mphy':
>> drivers/net/e1000/base/e1000_phy.c:4221:2:
>> error: this 'if' clause does not guard... [-Werror=misleading-indentation]
>> if (locked)
>> ^~
>>
>> drivers/net/e1000/base/e1000_phy.c:4223:3:
>> note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
>> if (!ready)
>> ^~
>>
>> Signed-off-by: Markos Chandras <mchandras at suse.de>
>> ---
> 
> Any particular compiler flags needed to reproduce this issue? Compiling with
> gcc6.1 I don't see any errors reported.
> 
> /Bruce
> 

I only have the log from the 2.2.0 + gcc-6 build so here is the line

gcc -Wp,-MD,./.e1000_phy.o.d.tmp -m64 -pthread -fPIC  -march=core2
-DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2
-DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3
-DRTE_COMPILE_TIME_CPUFLAGS
=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3
-I/home/abuild/rpmbuild/BUILD/dpdk-2.2.0/x86_64-native-linuxapp-gcc/include
-include
/home/abuild/rpmbuild/BUILD/dpdk-2.2.0/x86_64-native-linuxapp-gcc/include/rte_config.h
-O3 -W -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wold-style-definition -Wpointer-arith
-Wcast-align -Wnested-externs -Wcast-qual -Wformat-nonli
teral -Wformat-security -Wundef -Wwrite-strings -Wno-uninitialized
-Wno-unused-parameter -Wno-unused-variable -fmessage-length=0
-grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2
-fstack-protector-strong -funw
ind-tables -fasynchronous-unwind-tables -g -Wformat -fPIC
-Wno-error=array-bounds -o e1000_phy.o -c
/home/abuild/rpmbuild/BUILD/dpdk-2.2.0/drivers/net/e1000/base/e1000_phy.c

But next time I will make sure I will add the command line that causes
the problem in the comment section of the patch as well.

-- 
markos

SUSE LINUX GmbH | GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg) Maxfeldstr. 5, D-90409, Nürnberg


More information about the dev mailing list