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

MinGW header error: expected ';' before 'void' issue with -std=c89 #200

Open
carlo-bramini opened this issue Sep 24, 2024 · 1 comment
Open

Comments

@carlo-bramini
Copy link

carlo-bramini commented Sep 24, 2024

Create a simple C file and put something for including _mingw.h, for example:

#include <stdio.h>

Next, save this single-line source file with a name, for example test.c.
Finally, try to compile it with the cross compiler with this line:

aarch64-w64-mingw32-gcc -c test.c -o test.o -std=c89

This test will print this error message on the console:

/usr/aarch64-w64-mingw32/sys-root/mingw/include/_mingw.h:610:25: error: expected ';' before 'void'
  610 | __MINGW_FASTFAIL_INLINE void __cdecl __MINGW_ATTRIB_NORETURN __fastfail(unsigned int code)
      |                         ^~~~

The key of the problem is the -std=c89 option to GCC, which makes the inline keyword to be not recognized.
Only aarch64-w64-mingw32 is affected, i686-w64-mingw32 and x86_64-w64-mingw32 compiles without troubles, even when -std=c89 is included.
The problem happens when you try to compile libopusfile because its configure script adds this option to the command line.

@Blackhex
Copy link
Member

Thank you for the report. So far we've not been focusing on handling/testing all the possible C standard options so it's great that you've tried that. Let me try to reproduce and investigate this issue more...

@Blackhex Blackhex changed the title mingw-woarm64: cannot compile C89 code. MinGW header error: expected ';' before 'void' issue with -std=c89 Sep 29, 2024
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

2 participants