-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build failure with stricter C compilers (e.g. GCC 14) #608
Milestone
Comments
ueno
added a commit
to ueno/p11-kit
that referenced
this issue
Dec 2, 2023
The build fails when compiling for 32-bit platforms with -Werror=incompatible-pointer-types: CFLAGS="-m32 -march=i686 -Werror=incompatible-pointer-types -Werror=implicit -Werror=int-conversion" setarch i686 -- meson setup _build setarch i686 -- meson compile -C _build -v ... ../p11-kit/import-object.c: In function ‘add_attrs_pubkey_rsa’: ../p11-kit/import-object.c:223:62: error: passing argument 3 of ‘p11_asn1_read’ from incompatible pointer type [-Werror=incompatible-pointer-types] 223 | attr_modulus.pValue = p11_asn1_read (asn, "modulus", &attr_modulus.ulValueLen); | ^~~~~~~~~~~~~~~~~~~~~~~~ | | | long unsigned int * Reported by Sam James in: p11-glue#608 Signed-off-by: Daiki Ueno <ueno@gnu.org>
Thanks for the report; #609 should fix it. I guess we should enable 32-bit build in our CI to catch this kind of problems. |
Thank you! Yeah, that's a good idea. I haven't looked at your CI setup but I can look at doing that if you need me to. The patch works for me, the quick response is really appreciated as going through quite a few of these. |
ueno
added a commit
to ueno/p11-kit
that referenced
this issue
Dec 4, 2023
The build fails when compiling for 32-bit platforms with -Werror=incompatible-pointer-types: CFLAGS="-m32 -march=i686 -Werror=incompatible-pointer-types -Werror=implicit -Werror=int-conversion" setarch i686 -- meson setup _build setarch i686 -- meson compile -C _build -v ... ../p11-kit/import-object.c: In function ‘add_attrs_pubkey_rsa’: ../p11-kit/import-object.c:223:62: error: passing argument 3 of ‘p11_asn1_read’ from incompatible pointer type [-Werror=incompatible-pointer-types] 223 | attr_modulus.pValue = p11_asn1_read (asn, "modulus", &attr_modulus.ulValueLen); | ^~~~~~~~~~~~~~~~~~~~~~~~ | | | long unsigned int * Reported by Sam James in: p11-glue#608 Signed-off-by: Daiki Ueno <ueno@gnu.org>
ueno
added a commit
to ueno/p11-kit
that referenced
this issue
Dec 4, 2023
The build fails when compiling for 32-bit platforms with -Werror=incompatible-pointer-types: CFLAGS="-m32 -march=i686 -Werror=incompatible-pointer-types -Werror=implicit -Werror=int-conversion" setarch i686 -- meson setup _build setarch i686 -- meson compile -C _build -v ... ../p11-kit/import-object.c: In function ‘add_attrs_pubkey_rsa’: ../p11-kit/import-object.c:223:62: error: passing argument 3 of ‘p11_asn1_read’ from incompatible pointer type [-Werror=incompatible-pointer-types] 223 | attr_modulus.pValue = p11_asn1_read (asn, "modulus", &attr_modulus.ulValueLen); | ^~~~~~~~~~~~~~~~~~~~~~~~ | | | long unsigned int * Reported by Sam James in: p11-glue#608 Signed-off-by: Daiki Ueno <ueno@gnu.org>
ueno
added a commit
that referenced
this issue
Dec 4, 2023
The build fails when compiling for 32-bit platforms with -Werror=incompatible-pointer-types: CFLAGS="-m32 -march=i686 -Werror=incompatible-pointer-types -Werror=implicit -Werror=int-conversion" setarch i686 -- meson setup _build setarch i686 -- meson compile -C _build -v ... ../p11-kit/import-object.c: In function ‘add_attrs_pubkey_rsa’: ../p11-kit/import-object.c:223:62: error: passing argument 3 of ‘p11_asn1_read’ from incompatible pointer type [-Werror=incompatible-pointer-types] 223 | attr_modulus.pValue = p11_asn1_read (asn, "modulus", &attr_modulus.ulValueLen); | ^~~~~~~~~~~~~~~~~~~~~~~~ | | | long unsigned int * Reported by Sam James in: #608 Signed-off-by: Daiki Ueno <ueno@gnu.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Modern C compilers are becoming stricter with a variety of changes over the last year or so.
GCC 14 in particular (to be released in ~April 2024) fails to build p11-kit-0.25.3 like:
Originally reported downstream in Gentoo at https://bugs.gentoo.org/918982.
This can be emulated with
-Werror=incompatible-pointer-types -Werror=implicit -Werror=int-conversion
on an older GCC or Clang.The text was updated successfully, but these errors were encountered: