From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752776AbdFLUbY (ORCPT ); Mon, 12 Jun 2017 16:31:24 -0400 Received: from resqmta-po-06v.sys.comcast.net ([96.114.154.165]:48548 "EHLO resqmta-po-06v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752705AbdFLUbW (ORCPT ); Mon, 12 Jun 2017 16:31:22 -0400 Reply-To: shuah@kernel.org Subject: Re: [PATCH v1 2/2] selftests: kselftest_harness: Fix compile warning To: Kees Cook , =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= Cc: LKML , Andy Lutomirski , Will Drewry , linux-kselftest@vger.kernel.org, Linux-Next , Shuah Khan , Shuah Khan References: <20170611123258.19624-1-mic@digikod.net> <20170611123258.19624-3-mic@digikod.net> From: Shuah Khan Message-ID: Date: Mon, 12 Jun 2017 14:31:20 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfEZDlhRvV7LxVajGUC2R+53iLvD1pb41ipLuipK8RKxYWIK23fQ4UmtfzAV/yasBt1bIJ9ehWj1QQDmtTajZXcs5AYIFEfeRLD2q0GXAFQJjyO9CFaqN zy85kLk1gEyTQUGVneSrahKKOkr0RrucVKzq3WXuCEkUkWaM0Ukf9ujPTPHt4cH1yohQlwpQqTZN9VxOtaWBALIj2urS5YTAo6TDLGX4TFQUMlUDhpVKw6GB 8ZfB7VRaeNIM6vCv6gg/Xajbo6KUEVFIrZHTbnETJMLKCGZnzBcXUAu+J1yuv9p/Nhs/eGhi9T4uW0BGjLP1w3X4baNFOLhirNYmbUGq2Acbo/5W52QsxEGz dbpqIKvMrYsvC1075z3iodr/WLwUYMpjAOzz7oQanpx2/RA5H4xv5o1ombCiYEFjAzT+Nb5e6J7eid4an8QBPI6PSBAKOA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/11/2017 08:22 PM, Kees Cook wrote: > On Sun, Jun 11, 2017 at 5:32 AM, Mickaël Salaün 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 >> Cc: Andy Lutomirski >> Cc: Kees Cook >> Cc: Shuah Khan >> Cc: Will Drewry > > Eek, thanks for catching that. :) > > Acked-by: Kees Cook > > -Kees Thanks. Ths fix is now in linux-kselftest next. -- Shuah