Skip to content
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

Warning when including ffi.h on i386/x86 machines #769

Open
dpgeorge opened this issue Feb 9, 2023 · 0 comments
Open

Warning when including ffi.h on i386/x86 machines #769

dpgeorge opened this issue Feb 9, 2023 · 0 comments

Comments

@dpgeorge
Copy link

dpgeorge commented Feb 9, 2023

System Details

  • Intel x86-64 machine, Arch Linux
  • libffi version 3.4.4-1 and lib32-lbiffi version 3.4.4-1 (from Arch Linux package manager)

Problems Description

The following warning is obtained when building with gcc -m32, ie in 32-bit mode (and since -Werror is used this turns into a compile error):

/usr/include/ffitarget.h:44:2: error: #warning ****************************************************** [-Werror=cpp]
   44 | #warning ******************************************************
      |  ^~~~~~~
/usr/include/ffitarget.h:45:2: error: #warning ********** X86 IS DEFINED **************************** [-Werror=cpp]
   45 | #warning ********** X86 IS DEFINED ****************************
      |  ^~~~~~~
/usr/include/ffitarget.h:46:2: error: #warning ****************************************************** [-Werror=cpp]
   46 | #warning ******************************************************
      |  ^~~~~~~
cc1: all warnings being treated as errors

It seems like this problem was introduced in commit b05dc51, which simply added this warning message. Since ffi.h unconditionally defines the symbol X64_64 it's hard to see how this warning could be avoided.

What is the correct way to use libffi on a 64-bit machine in 32-bit mode (ie gcc -m32)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant