[PATCH] configure.ac: don't use -Wmisleading-indentation compiler option (GCC11)

Eric Pouech eric.pouech at gmail.com
Mon Sep 27 12:27:53 CDT 2021


in tests, there's a lot of constructs like:

    bla1;
    bla2;
todo_wine
    ok(tst, "...");
    bla3;

or

    bla1;
    bla2;
    todo_wine
    ok(tst, "...");
    bla3;

GCC11 complains about those (and some more complex) about bla3 not being
properly indented wrt the todo_wine.

I'm not 100% sure about the right fix:
- disable the warning altogether (that's what this patch does), but we
  won't report other *real* indentation errors. To be frank, I haven't
  looked at the hundred of lines of warnings to check if one pops up.
- reformat the code in tests. note that
    todo_wine {
	ok(tst, "...");
    }
  or
    todo_wine ok(tst, "...");
  or
    todo_wine
	ok(tst, "...");
  don't generate warnings. but first one defeats the one liner, and the
  second and third ones don't preserve the line of the test unchanged
  when the todo is resolved

I'd favor disabling the compiler option (it's the less intrusive in the
code and in dev:s habits).

A+
Signed-off-by: Eric Pouech <eric.pouech at gmail.com>

---
 configure.ac |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure.ac b/configure.ac
index a019b4ac2d6..6cd3e915aae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1002,6 +1002,7 @@ then
                                   CFLAGS="$CFLAGS $llvm_cflags"])
         fi
         WINE_TRY_CROSSCFLAGS([-fno-strict-aliasing])
+        WINE_TRY_CROSSCFLAGS([-Wno-misleading-indentation])
         dnl clang needs to be told to fail on unknown options
         WINE_TRY_CROSSCFLAGS([-Werror=unknown-warning-option],[CFLAGS="$CFLAGS -Werror=unknown-warning-option"])
         WINE_TRY_CROSSCFLAGS([-Werror=ignored-optimization-argument],[CFLAGS="$CFLAGS -Werror=ignored-optimization-argument"])
@@ -1992,6 +1993,7 @@ then
   WINE_TRY_CFLAGS([-Wunused-but-set-parameter])
   WINE_TRY_CFLAGS([-Wvla])
   WINE_TRY_CFLAGS([-Wwrite-strings])
+  WINE_TRY_CFLAGS([-Wno-misleading-indentation])
 
   if test -z "$CROSSTARGET"
   then




More information about the wine-devel mailing list