# Re: \[PATCH v5\] perf tools: Fix arm64 build error with gcc-11

- From: John Garry \<hidden\>
- Date: 2021-02-18 10:50:52 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2021/02/6272819
- Thread: https://ratatoskr.run/linux-arm-kernel/2021/02/6272552/t.md

```text
On 18/02/2021 03:12, Jianlin Lv wrote:
> gcc version: 11.0.0 20210208 (experimental) (GCC)
>
> Following build error on arm64:
>
> .......
> In function ‘printf’,
>      inlined from ‘regs_dump__printf’ at util/session.c:1141:3,
>      inlined from ‘regs__printf’ at util/session.c:1169:2:
> /usr/include/aarch64-linux-gnu/bits/stdio2.h:107:10: \
>    error: ‘%-5s’ directive argument is null [-Werror=format-overflow=]
>
> 107 |   return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, \
>                  __va_arg_pack ());
>
> ......
> In function ‘fprintf’,
>    inlined from ‘perf_sample__fprintf_regs.isra’ at \
>      builtin-script.c:622:14:
> /usr/include/aarch64-linux-gnu/bits/stdio2.h:100:10: \
>      error: ‘%5s’ directive argument is null [-Werror=format-overflow=]
>    100 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
>    101 |                         __va_arg_pack ());
>
> cc1: all warnings being treated as errors
> .......
>
> This patch fixes Wformat-overflow warnings. Add helper function to
> convert NULL to "unknown".
>
> Signed-off-by: Jianlin Lv<redacted>

thanks
Reviewed-by: John Garry <redacted>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```
