Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Fix compile error in configure script

Edgar Bonet
May 17, 2024 03:28PM
Hello!

Sergey Kandaurov wrote:
> > objs/autotest.c:9:48: error: passing argument 1
> > of 'AO_compare_and_swap' from incompatible pointer type
> > [-Wincompatible-pointer-types]
>
> Where did you try to build?

I experienced this when building for arm and i686, both cross-compiled
from x86_64. Building for x86_64 works fine.

> Usually, long and size_t (a "common default" for AO_t) have the same
> underlying type, unless you build with something like MSVC.

AO_t is a 'volatile size_t'. The volatile qualifier may not matter
though. The error message about incompatible types was followed by
this note:

expected 'volatile size_t *' {aka 'volatile unsigned int *'}
but argument is of type 'long int *'

My understanding is that the compiler considers 'int' and 'long' to be
incompatible types, even though they have the same underlying
representation on ILP32 environments. I'm not a language lawyer, so I
cannot tell _why_ they are considered incompatible. But then, 'size_t'
being an 'unsigned int', it is incompatible with 'long'.

On LP64 (your typical 64-bit Linux/Mac), 'size_t' is a 'unsigned long',
which is compatible with 'long' but for the signedness warning.

Regards,

Edgar.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Fix compile error in configure script

Edgar Bonet 234 May 16, 2024 05:26AM

Re: [PATCH] Fix compile error in configure script

Sergey Kandaurov 49 May 17, 2024 01:44PM

Re: [PATCH] Fix compile error in configure script

Edgar Bonet 55 May 17, 2024 03:28PM

Re: [PATCH] Fix compile error in configure script

Edgar Bonet 58 May 18, 2024 08:46AM

Re: [PATCH] Fix compile error in configure script

Sergey Kandaurov 50 May 20, 2024 04:22PM

Re: [PATCH] Fix compile error in configure script

Edgar Bonet 76 May 20, 2024 04:52PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 88
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready