Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1664209

Re: [PATCH v1 2/2] selftests: kselftest_harness: Fix compile warning

From Shuah Khan <shuah@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v1 2/2] selftests: kselftest_harness: Fix compile warning
Date 2017-06-12 22:40 +0200
Message-ID <tREhX-71h-11@gated-at.bofh.it> (permalink)
References <tRajT-54m-3@gated-at.bofh.it> <tRajU-54m-9@gated-at.bofh.it> <tRnh7-4Ei-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 06/11/2017 08:22 PM, Kees Cook wrote:
> On Sun, Jun 11, 2017 at 5:32 AM, Mickaël Salaün <mic@digikod.net> wrote:
>> Do not confuse the compiler with a semicolon preceding a block. Replace
>> the semicolon with an empty block to avoid a warning:
>>
>>   gcc -Wl,-no-as-needed -Wall -lpthread seccomp_bpf.c -o /.../linux/tools/testing/selftests/seccomp/seccomp_bpf
>>   In file included from seccomp_bpf.c:40:0:
>>   seccomp_bpf.c: In function ‘change_syscall’:
>>   ../kselftest_harness.h:558:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
>>     for (; _metadata->trigger;  _metadata->trigger = __bail(_assert))
>>     ^
>>   ../kselftest_harness.h:574:14: note: in expansion of macro ‘OPTIONAL_HANDLER’
>>    } while (0); OPTIONAL_HANDLER(_assert)
>>                 ^~~~~~~~~~~~~~~~
>>   ../kselftest_harness.h:440:2: note: in expansion of macro ‘__EXPECT’
>>     __EXPECT(expected, seen, ==, 0)
>>     ^~~~~~~~
>>   seccomp_bpf.c:1313:2: note: in expansion of macro ‘EXPECT_EQ’
>>     EXPECT_EQ(0, ret);
>>     ^~~~~~~~~
>>   seccomp_bpf.c:1317:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘for’
>>     {
>>     ^
>>
>> Signed-off-by: Mickaël Salaün <mic@digikod.net>
>> Cc: Andy Lutomirski <luto@amacapital.net>
>> Cc: Kees Cook <keescook@chromium.org>
>> Cc: Shuah Khan <shuahkh@osg.samsung.com>
>> Cc: Will Drewry <wad@chromium.org>
> 
> Eek, thanks for catching that. :)
> 
> Acked-by: Kees Cook <keescook@chromium.org>
> 
> -Kees

Thanks. Ths fix is now in linux-kselftest next.

-- Shuah

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v1 0/2] Fix kselftest_harness regression Mickaël Salaün <mic@digikod.net> - 2017-06-11 14:40 +0200
  [PATCH v1 1/2] Revert "selftests: kselftest_harness: fix compile warnings" Mickaël Salaün <mic@digikod.net> - 2017-06-11 14:40 +0200
  [PATCH v1 2/2] selftests: kselftest_harness: Fix compile warning Mickaël Salaün <mic@digikod.net> - 2017-06-11 14:40 +0200
    Re: [PATCH v1 2/2] selftests: kselftest_harness: Fix compile warning Kees Cook <keescook@chromium.org> - 2017-06-12 04:30 +0200
      Re: [PATCH v1 2/2] selftests: kselftest_harness: Fix compile warning Shuah Khan <shuah@kernel.org> - 2017-06-12 22:40 +0200

csiph-web