Stop asking the compiler to error out on things that offend a C89 standard compiler... like declaring variables in the middle of a function. We do not care, and such a check is preventing DOSBox-X from compiling

This commit is contained in:
Jonathan Campbell 2023-04-01 01:39:41 -07:00
parent 10add4401b
commit edba71e696
2 changed files with 17 additions and 17 deletions

View File

@ -1,3 +1,11 @@
Next:
- SDL2: Stop checking for compiler flags that make it an error to
declare variables after statements in a function or any other
terrible sins that would offend old C89 standard compilers.
DOSBox-X is never going to compile for a C standard that old.
Furthermore this check is preventing compilation on ARM-based
Macbooks for some reason, though not Intel based Macbooks.
2023.03.31
- "mount -t overlay" will now print a message on the console to
let you know if the act of mounting the overlay replaced a

View File

@ -1334,25 +1334,17 @@ CheckStackBoundary()
dnl See if GCC's -Wdeclaration-after-statement is supported.
dnl This lets us catch things that would fail on a C89 compiler when using
dnl a modern GCC.
dnl
dnl EDIT 2023/04/01 DOSBox-X: We don't care about ancient compilers. A compiler
dnl that old doesn't support C++ and even if it did, it wouldn't be new enough
dnl for this code base. We have to disable this because this is preventing
dnl DOSBox-X from compiling with the latest XCode on ARM-based Macbooks because
dnl the *.m files have variable declarations after statements. At no point is
dnl this code going to compile itself like it's 1993. Come on guys. --J.C.
CheckDeclarationAfterStatement()
{
AC_MSG_CHECKING(for GCC -Wdeclaration-after-statement option)
have_gcc_declaration_after_statement=no
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
AC_TRY_COMPILE([
int x = 0;
],[
],[
have_gcc_declaration_after_statement=yes
])
AC_MSG_RESULT($have_gcc_declaration_after_statement)
CFLAGS="$save_CFLAGS"
if test x$have_gcc_declaration_after_statement = xyes; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -Wdeclaration-after-statement -Werror=declaration-after-statement"
fi
dnl We don't care about C89 compilers.
true
}
dnl See if GCC's -Wall is supported.