* [PATCH] selftests/harness: Update named initializer syntax
@ 2019-01-27 9:42 ` Kees Cook
0 siblings, 0 replies; 6+ messages in thread
From: keescook @ 2019-01-27 9:42 UTC (permalink / raw)
The harness was still using old-style GNU named initializer syntax.
Fix this so Clang will stop warning:
seccomp_bpf.c:2924:1: warning: use of GNU old-style field designator extension
[-Wgnu-designator]
./../kselftest_harness.h:147:25: note: expanded from macro 'TEST'
^
./../kselftest_harness.h:172:5: note: expanded from macro '__TEST_IMPL'
fn: &test_name, termsig: _signal }; \
^
Signed-off-by: Kees Cook <keescook at chromium.org>
---
tools/testing/selftests/kselftest_harness.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index 76d654ef3234..2d90c98eeb67 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -168,8 +168,8 @@
#define __TEST_IMPL(test_name, _signal) \
static void test_name(struct __test_metadata *_metadata); \
static struct __test_metadata _##test_name##_object = \
- { name: "global." #test_name, \
- fn: &test_name, termsig: _signal }; \
+ { .name = "global." #test_name, \
+ .fn = &test_name, .termsig = _signal }; \
static void __attribute__((constructor)) _register_##test_name(void) \
{ \
__register_test(&_##test_name##_object); \
@@ -304,9 +304,9 @@
} \
static struct __test_metadata \
_##fixture_name##_##test_name##_object = { \
- name: #fixture_name "." #test_name, \
- fn: &wrapper_##fixture_name##_##test_name, \
- termsig: signal, \
+ .name = #fixture_name "." #test_name, \
+ .fn = &wrapper_##fixture_name##_##test_name, \
+ .termsig = signal, \
}; \
static void __attribute__((constructor)) \
_register_##fixture_name##_##test_name(void) \
--
2.17.1
--
Kees Cook
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] selftests/harness: Update named initializer syntax
@ 2019-01-27 9:42 ` Kees Cook
0 siblings, 0 replies; 6+ messages in thread
From: Kees Cook @ 2019-01-27 9:42 UTC (permalink / raw)
The harness was still using old-style GNU named initializer syntax.
Fix this so Clang will stop warning:
seccomp_bpf.c:2924:1: warning: use of GNU old-style field designator extension
[-Wgnu-designator]
./../kselftest_harness.h:147:25: note: expanded from macro 'TEST'
^
./../kselftest_harness.h:172:5: note: expanded from macro '__TEST_IMPL'
fn: &test_name, termsig: _signal }; \
^
Signed-off-by: Kees Cook <keescook at chromium.org>
---
tools/testing/selftests/kselftest_harness.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index 76d654ef3234..2d90c98eeb67 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -168,8 +168,8 @@
#define __TEST_IMPL(test_name, _signal) \
static void test_name(struct __test_metadata *_metadata); \
static struct __test_metadata _##test_name##_object = \
- { name: "global." #test_name, \
- fn: &test_name, termsig: _signal }; \
+ { .name = "global." #test_name, \
+ .fn = &test_name, .termsig = _signal }; \
static void __attribute__((constructor)) _register_##test_name(void) \
{ \
__register_test(&_##test_name##_object); \
@@ -304,9 +304,9 @@
} \
static struct __test_metadata \
_##fixture_name##_##test_name##_object = { \
- name: #fixture_name "." #test_name, \
- fn: &wrapper_##fixture_name##_##test_name, \
- termsig: signal, \
+ .name = #fixture_name "." #test_name, \
+ .fn = &wrapper_##fixture_name##_##test_name, \
+ .termsig = signal, \
}; \
static void __attribute__((constructor)) \
_register_##fixture_name##_##test_name(void) \
--
2.17.1
--
Kees Cook
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] selftests/harness: Update named initializer syntax
@ 2019-01-27 9:42 ` Kees Cook
0 siblings, 0 replies; 6+ messages in thread
From: Kees Cook @ 2019-01-27 9:42 UTC (permalink / raw)
To: Shuah Khan; +Cc: linux-kernel, linux-kselftest, ndesaulniers
The harness was still using old-style GNU named initializer syntax.
Fix this so Clang will stop warning:
seccomp_bpf.c:2924:1: warning: use of GNU old-style field designator extension
[-Wgnu-designator]
./../kselftest_harness.h:147:25: note: expanded from macro 'TEST'
^
./../kselftest_harness.h:172:5: note: expanded from macro '__TEST_IMPL'
fn: &test_name, termsig: _signal }; \
^
Signed-off-by: Kees Cook <keescook@chromium.org>
---
tools/testing/selftests/kselftest_harness.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index 76d654ef3234..2d90c98eeb67 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -168,8 +168,8 @@
#define __TEST_IMPL(test_name, _signal) \
static void test_name(struct __test_metadata *_metadata); \
static struct __test_metadata _##test_name##_object = \
- { name: "global." #test_name, \
- fn: &test_name, termsig: _signal }; \
+ { .name = "global." #test_name, \
+ .fn = &test_name, .termsig = _signal }; \
static void __attribute__((constructor)) _register_##test_name(void) \
{ \
__register_test(&_##test_name##_object); \
@@ -304,9 +304,9 @@
} \
static struct __test_metadata \
_##fixture_name##_##test_name##_object = { \
- name: #fixture_name "." #test_name, \
- fn: &wrapper_##fixture_name##_##test_name, \
- termsig: signal, \
+ .name = #fixture_name "." #test_name, \
+ .fn = &wrapper_##fixture_name##_##test_name, \
+ .termsig = signal, \
}; \
static void __attribute__((constructor)) \
_register_##fixture_name##_##test_name(void) \
--
2.17.1
--
Kees Cook
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] selftests/harness: Update named initializer syntax
@ 2019-01-27 10:10 ` Nick Desaulniers
0 siblings, 0 replies; 6+ messages in thread
From: ndesaulniers @ 2019-01-27 10:10 UTC (permalink / raw)
On Sun, Jan 27, 2019 at 1:42 AM Kees Cook <keescook at chromium.org> wrote:
>
> The harness was still using old-style GNU named initializer syntax.
> Fix this so Clang will stop warning:
>
> seccomp_bpf.c:2924:1: warning: use of GNU old-style field designator extension
> [-Wgnu-designator]
> ./../kselftest_harness.h:147:25: note: expanded from macro 'TEST'
> ^
> ./../kselftest_harness.h:172:5: note: expanded from macro '__TEST_IMPL'
> fn: &test_name, termsig: _signal }; \
> ^
>
> Signed-off-by: Kees Cook <keescook at chromium.org>
> ---
> tools/testing/selftests/kselftest_harness.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
> index 76d654ef3234..2d90c98eeb67 100644
> --- a/tools/testing/selftests/kselftest_harness.h
> +++ b/tools/testing/selftests/kselftest_harness.h
> @@ -168,8 +168,8 @@
> #define __TEST_IMPL(test_name, _signal) \
> static void test_name(struct __test_metadata *_metadata); \
> static struct __test_metadata _##test_name##_object = \
> - { name: "global." #test_name, \
> - fn: &test_name, termsig: _signal }; \
> + { .name = "global." #test_name, \
> + .fn = &test_name, .termsig = _signal }; \
> static void __attribute__((constructor)) _register_##test_name(void) \
> { \
> __register_test(&_##test_name##_object); \
> @@ -304,9 +304,9 @@
> } \
> static struct __test_metadata \
> _##fixture_name##_##test_name##_object = { \
> - name: #fixture_name "." #test_name, \
> - fn: &wrapper_##fixture_name##_##test_name, \
> - termsig: signal, \
> + .name = #fixture_name "." #test_name, \
> + .fn = &wrapper_##fixture_name##_##test_name, \
> + .termsig = signal, \
My favorite feature of C, stolen now in C++20. Thanks for cleaning this up.
Reviewed-by: Nick Desaulniers <ndesaulniers at google.com>
> }; \
> static void __attribute__((constructor)) \
> _register_##fixture_name##_##test_name(void) \
> --
> 2.17.1
>
>
> --
> Kees Cook
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] selftests/harness: Update named initializer syntax
@ 2019-01-27 10:10 ` Nick Desaulniers
0 siblings, 0 replies; 6+ messages in thread
From: Nick Desaulniers @ 2019-01-27 10:10 UTC (permalink / raw)
On Sun, Jan 27, 2019@1:42 AM Kees Cook <keescook@chromium.org> wrote:
>
> The harness was still using old-style GNU named initializer syntax.
> Fix this so Clang will stop warning:
>
> seccomp_bpf.c:2924:1: warning: use of GNU old-style field designator extension
> [-Wgnu-designator]
> ./../kselftest_harness.h:147:25: note: expanded from macro 'TEST'
> ^
> ./../kselftest_harness.h:172:5: note: expanded from macro '__TEST_IMPL'
> fn: &test_name, termsig: _signal }; \
> ^
>
> Signed-off-by: Kees Cook <keescook at chromium.org>
> ---
> tools/testing/selftests/kselftest_harness.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
> index 76d654ef3234..2d90c98eeb67 100644
> --- a/tools/testing/selftests/kselftest_harness.h
> +++ b/tools/testing/selftests/kselftest_harness.h
> @@ -168,8 +168,8 @@
> #define __TEST_IMPL(test_name, _signal) \
> static void test_name(struct __test_metadata *_metadata); \
> static struct __test_metadata _##test_name##_object = \
> - { name: "global." #test_name, \
> - fn: &test_name, termsig: _signal }; \
> + { .name = "global." #test_name, \
> + .fn = &test_name, .termsig = _signal }; \
> static void __attribute__((constructor)) _register_##test_name(void) \
> { \
> __register_test(&_##test_name##_object); \
> @@ -304,9 +304,9 @@
> } \
> static struct __test_metadata \
> _##fixture_name##_##test_name##_object = { \
> - name: #fixture_name "." #test_name, \
> - fn: &wrapper_##fixture_name##_##test_name, \
> - termsig: signal, \
> + .name = #fixture_name "." #test_name, \
> + .fn = &wrapper_##fixture_name##_##test_name, \
> + .termsig = signal, \
My favorite feature of C, stolen now in C++20. Thanks for cleaning this up.
Reviewed-by: Nick Desaulniers <ndesaulniers at google.com>
> }; \
> static void __attribute__((constructor)) \
> _register_##fixture_name##_##test_name(void) \
> --
> 2.17.1
>
>
> --
> Kees Cook
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] selftests/harness: Update named initializer syntax
@ 2019-01-27 10:10 ` Nick Desaulniers
0 siblings, 0 replies; 6+ messages in thread
From: Nick Desaulniers @ 2019-01-27 10:10 UTC (permalink / raw)
To: Kees Cook; +Cc: Shuah Khan, LKML, linux-kselftest
On Sun, Jan 27, 2019 at 1:42 AM Kees Cook <keescook@chromium.org> wrote:
>
> The harness was still using old-style GNU named initializer syntax.
> Fix this so Clang will stop warning:
>
> seccomp_bpf.c:2924:1: warning: use of GNU old-style field designator extension
> [-Wgnu-designator]
> ./../kselftest_harness.h:147:25: note: expanded from macro 'TEST'
> ^
> ./../kselftest_harness.h:172:5: note: expanded from macro '__TEST_IMPL'
> fn: &test_name, termsig: _signal }; \
> ^
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> tools/testing/selftests/kselftest_harness.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
> index 76d654ef3234..2d90c98eeb67 100644
> --- a/tools/testing/selftests/kselftest_harness.h
> +++ b/tools/testing/selftests/kselftest_harness.h
> @@ -168,8 +168,8 @@
> #define __TEST_IMPL(test_name, _signal) \
> static void test_name(struct __test_metadata *_metadata); \
> static struct __test_metadata _##test_name##_object = \
> - { name: "global." #test_name, \
> - fn: &test_name, termsig: _signal }; \
> + { .name = "global." #test_name, \
> + .fn = &test_name, .termsig = _signal }; \
> static void __attribute__((constructor)) _register_##test_name(void) \
> { \
> __register_test(&_##test_name##_object); \
> @@ -304,9 +304,9 @@
> } \
> static struct __test_metadata \
> _##fixture_name##_##test_name##_object = { \
> - name: #fixture_name "." #test_name, \
> - fn: &wrapper_##fixture_name##_##test_name, \
> - termsig: signal, \
> + .name = #fixture_name "." #test_name, \
> + .fn = &wrapper_##fixture_name##_##test_name, \
> + .termsig = signal, \
My favorite feature of C, stolen now in C++20. Thanks for cleaning this up.
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
> }; \
> static void __attribute__((constructor)) \
> _register_##fixture_name##_##test_name(void) \
> --
> 2.17.1
>
>
> --
> Kees Cook
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-01-27 10:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-27 9:42 [PATCH] selftests/harness: Update named initializer syntax keescook
2019-01-27 9:42 ` Kees Cook
2019-01-27 9:42 ` Kees Cook
2019-01-27 10:10 ` ndesaulniers
2019-01-27 10:10 ` Nick Desaulniers
2019-01-27 10:10 ` Nick Desaulniers
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.