[V2,2/6] Clang: __unused is illegal varible name for newer version clang

Submitted by Zhang, Ning A on April 2, 2019, 2:43 a.m.

Details

Message ID 20190402024304.9899-3-ning.a.zhang@intel.com
State New
Series "patches for build CRIU with Android NDK"
Headers show

Commit Message

Zhang, Ning A April 2, 2019, 2:43 a.m.
From: Zhang Ning <ning.a.zhang@intel.com>

with Android P's Clang versoin: 6.0.2, and Android NDK's Clang version 8.0.2

Clang will report below error:
criu/compel/include/uapi/compel/sigframe-common.h:55:34: error: expected member name or ';' after declaration specifiers
        int                     __unused[32 - (sizeof (k_rtsigset_t) / sizeof (int))];
        ~~~                             ^

it takes __unused as an attribute, not a varible, chang to _unused, pass compile.

Cc: Chen Hu <hu1.chen@intel.com>
Signed-off-by: Zhang Ning <ning.a.zhang@intel.com>
---
 compel/include/uapi/sigframe-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/compel/include/uapi/sigframe-common.h b/compel/include/uapi/sigframe-common.h
index 0796bb37..e35c8655 100644
--- a/compel/include/uapi/sigframe-common.h
+++ b/compel/include/uapi/sigframe-common.h
@@ -52,7 +52,7 @@  struct rt_ucontext {
 	rt_stack_t		uc_stack;
 	struct rt_sigcontext	uc_mcontext;
 	k_rtsigset_t		uc_sigmask;	/* mask last for extensibility */
-	int                     __unused[32 - (sizeof (k_rtsigset_t) / sizeof (int))];
+	int                     _unused[32 - (sizeof (k_rtsigset_t) / sizeof (int))];
 	unsigned long           uc_regspace[128] __attribute__((aligned(8)));
 };
 

Comments

Dmitry Safonov April 2, 2019, 2:41 p.m.
On Tue, 2 Apr 2019 at 03:44, <ning.a.zhang@intel.com> wrote:
>
> From: Zhang Ning <ning.a.zhang@intel.com>
>
> with Android P's Clang versoin: 6.0.2, and Android NDK's Clang version 8.0.2
>
> Clang will report below error:
> criu/compel/include/uapi/compel/sigframe-common.h:55:34: error: expected member name or ';' after declaration specifiers
>         int                     __unused[32 - (sizeof (k_rtsigset_t) / sizeof (int))];
>         ~~~                             ^
>
> it takes __unused as an attribute, not a varible, chang to _unused, pass compile.
>
> Cc: Chen Hu <hu1.chen@intel.com>
> Signed-off-by: Zhang Ning <ning.a.zhang@intel.com>

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>

> ---
>  compel/include/uapi/sigframe-common.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/compel/include/uapi/sigframe-common.h b/compel/include/uapi/sigframe-common.h
> index 0796bb37..e35c8655 100644
> --- a/compel/include/uapi/sigframe-common.h
> +++ b/compel/include/uapi/sigframe-common.h
> @@ -52,7 +52,7 @@ struct rt_ucontext {
>         rt_stack_t              uc_stack;
>         struct rt_sigcontext    uc_mcontext;
>         k_rtsigset_t            uc_sigmask;     /* mask last for extensibility */
> -       int                     __unused[32 - (sizeof (k_rtsigset_t) / sizeof (int))];
> +       int                     _unused[32 - (sizeof (k_rtsigset_t) / sizeof (int))];
>         unsigned long           uc_regspace[128] __attribute__((aligned(8)));
>  };
>
> --
> 2.20.1
>
> _______________________________________________
> CRIU mailing list
> CRIU@openvz.org
> https://lists.openvz.org/mailman/listinfo/criu