[CRIU] [PATCH 07/10] Fix armv7 compile with clang 4
Kirill Kolyshkin
kolyshkin at gmail.com
Mon Oct 2 07:34:18 MSK 2017
On Oct 1, 2017 9:19 PM, "Andrei Vagin" <avagin at virtuozzo.com> wrote:
On Sun, Oct 01, 2017 at 05:34:02PM -0700, Kir Kolyshkin wrote:
> With clang 4, the following error appears:
>
> > CC criu/pie/parasite.o
> > In file included from criu/pie/parasite.c:23:
> > criu/arch/arm/include/asm/parasite.h:6:21: error: this function
> > declaration is not a
> > prototype [-Werror,-Wstrict-prototypes]
> > *ptls = ((tls_t (*)())0xffff0fe0)();
> > ^
> > void
> > 1 error generated.
>
> Apparently, adding void fixes it.
>
> Signed-off-by: Kir Kolyshkin <kolyshkin at gmail.com>
> ---
> criu/arch/arm/include/asm/parasite.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/criu/arch/arm/include/asm/parasite.h
b/criu/arch/arm/include/asm/parasite.h
> index 7f62bb9d..0ed320ba 100644
> --- a/criu/arch/arm/include/asm/parasite.h
> +++ b/criu/arch/arm/include/asm/parasite.h
> @@ -3,7 +3,7 @@
>
> static inline void arch_get_tls(tls_t *ptls)
> {
> - *ptls = ((tls_t (*)())0xffff0fe0)();
> + *ptls = ((tls_t (*)(void))0xffff0fe0)();
do you mean void * ^^^^
No, what you see is a cast from a pointer to a function (followed by a call
to it). Here void is that function argument.
> }
>
> #endif
> --
> 2.14.1
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20171001/7644a4bd/attachment-0001.html>
More information about the CRIU
mailing list