Fatfs_diskio.c:172:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]

I am trying to build ardupilot main branch on Arch Linux.
I am able to setup environment and configure using waf. But I am always getting compilation error related to misleading-indentation because -Werror is enabled.

[1/1] ChibiOS: Compiling fatfs_diskio.c

../../modules/ChibiOS/os/various/fatfs_bindings/fatfs_diskio.c: In function 'disk_write':
../../modules/ChibiOS/os/various/fatfs_bindings/fatfs_diskio.c:172:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
  172 |     if (mmcIsWriteProtected(&FATFS_HAL_DEVICE))
      |     ^~
../../modules/ChibiOS/os/various/fatfs_bindings/fatfs_diskio.c:48:24: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   48 | #define FATFS_RETRY(x) do { uint8_t ii; for (ii=0; ii<FATFS_NUM_RETRIES; ii++) {if ((x)==0) break; else if (ii==FATFS_NUM_RETRIES-1) return RES_ERROR;}} while(0)
      |                        ^~
../../modules/ChibiOS/os/various/fatfs_bindings/fatfs_diskio.c:174:9: note: in expansion of macro 'FATFS_RETRY'
  174 |         FATFS_RETRY(mmcStartSequentialWrite(&FATFS_HAL_DEVICE, sector));
      |         ^~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [../../libraries/AP_HAL_ChibiOS/hwdef/common/chibios_common.mk:242: modules/ChibiOS/obj/fatfs_diskio.o] Error 1

Is there any way to disable -Werror and compile further with just compilation warnings ?

This is, I believe, due to ArduPilot using GCC version 10 or something, while Arch uses a newer one.

What is more, some of these warnings seem to be false-positives. Anyway, the easiest way seems to add explicit parentheses by hand. There are not too many of them, as far as I remember.

I downloaded gcc 10 (gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2) from arm website and used that. Its working with gcc 10.