[Skiboot] [PATCH] hw/ipmi: Fix misleading-indentation failures
Vasant Hegde
hegdevasant at linux.vnet.ibm.com
Wed Apr 7 16:42:10 AEST 2021
On 4/6/21 1:25 PM, Dan Horák wrote:
> On Mon, 5 Apr 2021 16:43:47 +0530
> Vasant Hegde <hegdevasant at linux.vnet.ibm.com> wrote:
>
>> Hitting below issue on recent distro (fedora-rawhide).
>
> could be due HOSTCC being gcc version 11
>
>>
>> sample failure:
>> ---------------
>> [ HOSTCC ] hw/ipmi/test/run-fru.c
>> In file included from hw/ipmi/test/run-fru.c:10:
>> hw/ipmi/test/../ipmi-fru.c: In function 'fru_fill_product_info':
>> hw/ipmi/test/../ipmi-fru.c:80:17: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
>>
>> 80 | if (rc < 1) return OPAL_PARAMETER; rc; })
>> | ^~
>> hw/ipmi/test/../ipmi-fru.c:102:18: note: in expansion of macro 'FRU_INSERT_STRING'
>> 102 | index += FRU_INSERT_STRING(&buf[index], info->manufacturer);
>> | ^~~~~~~~~~~~~~~~~
>> hw/ipmi/test/../ipmi-fru.c:80:52: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
>> 80 | if (rc < 1) return OPAL_PARAMETER; rc; })
>> | ^~
>> hw/ipmi/test/../ipmi-fru.c:102:18: note: in expansion of macro 'FRU_INSERT_STRING'
>> 102 | index += FRU_INSERT_STRING(&buf[index], info->manufacturer);
>> | ^~~~~~~~~~~~~~~~~
>>
>> Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
>
> LGTM, but would be useful to figure out why compiling ipmi-fru.c as
> part of the firmware doesn't produce the same warning.
We use cross compiler for firmware image building and test cases are built using
host compiler.
I guess above warning is not enabled in cross compiler we are using.
-Vasant
More information about the Skiboot
mailing list