]> git.draconx.ca Git - dxcommon.git/commitdiff
DX_C_ALIGNAS: Work around bash-5 parsing bug. master
authorNick Bowler <nbowler@draconx.ca>
Thu, 11 Apr 2024 00:57:36 +0000 (20:57 -0400)
committerNick Bowler <nbowler@draconx.ca>
Thu, 11 Apr 2024 00:57:36 +0000 (20:57 -0400)
Apparently bash-5 and later versions fail to parse for loops with
a newline before the 'in' keyword, if that loop itself is in a case.
statement.

Previous versions of bash have no such problem, nor does any other
shell I've tried, but the workaround is simple enough.

m4/align.m4

index 945beffe1d9b3c54ceff0a93677cde2662dd4ff2..a69e640d94fdd345df22a38eca9104884ab6f5a7 100644 (file)
@@ -59,7 +59,7 @@ AC_DEFUN([DX_C_ALIGNAS],
   [no/no|*/c89|*/c99],
     [AC_CACHE_CHECK([if $CC supports _Alignas], [dx_cv_have_alignas],
 [dx_cv_have_alignas=no
-for _dx_alignas
+for _dx_alignas dnl Eat newline to work around bash-5 parsing bug.
 in '_Alignas(X)' '__attribute__((__aligned__(X)))' '__declspec(align(X))'
 do
 AC_COMPUTE_INT([_dx_tmp],