[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribu
From: |
Peter Maydell |
Subject: |
Re: [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribute 'gnu_printf' |
Date: |
Mon, 28 Sep 2020 14:43:03 +0100 |
On Mon, 28 Sep 2020 at 14:37, Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
>
> Since commit efc6c070aca ("configure: Add a test for the minimum
> compiler version") the minimum compiler version required for GCC
> is 4.8, which supports the gnu_printf attribute.
>
> We can safely remove the code introduced in commit 9c9e7d51bf0
> ("Move macros GCC_ATTR and GCC_FMT_ATTR to common header file").
clang doesn't support the gnu_printf attribute, though:
$ clang --version
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ cat /tmp/zz9.c
#include <stdio.h>
int monitor_printf(void *mon, const char *fmt, ...)
__attribute__((format(gnu_printf, 2, 3)));
int main(void) {
printf("hello\n");
return 0;
}
$ clang -Wall -o /tmp/zz9 /tmp/zz9.c
/tmp/zz9.c:3:68: warning: 'format' attribute argument not supported:
gnu_printf [-Wignored-attributes]
int monitor_printf(void *mon, const char *fmt, ...)
__attribute__((format(gnu_printf, 2, 3)));
^
1 warning generated.
thanks
-- PMM
- [PATCH 0/3] qemu/compiler: Remove unused special case code for GCC < 4.8, Philippe Mathieu-Daudé, 2020/09/28
- [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribute 'gnu_printf', Philippe Mathieu-Daudé, 2020/09/28
- Re: [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribute 'gnu_printf',
Peter Maydell <=
- Re: [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribute 'gnu_printf', Daniel P . Berrangé, 2020/09/28
- Re: [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribute 'gnu_printf', Peter Maydell, 2020/09/28
- Re: [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribute 'gnu_printf', Daniel P . Berrangé, 2020/09/28
- Re: [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribute 'gnu_printf', Peter Maydell, 2020/09/28
- Re: [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribute 'gnu_printf', Daniel P . Berrangé, 2020/09/28
- Re: [PATCH 1/3] qemu/compiler: Simplify as all compilers support attribute 'gnu_printf', Paolo Bonzini, 2020/09/28
[PATCH 2/3] qemu/atomic: Drop special case for unsupported compiler, Philippe Mathieu-Daudé, 2020/09/28
[PATCH 3/3] accel/tcg: Remove special case for GCC < 4.6, Philippe Mathieu-Daudé, 2020/09/28