diff mbox series

[kvm-unit-tests] Makefile: Compile the kvm-unit-tests with -fno-strict-aliasing

Message ID 20200122152331.14062-1-thuth@redhat.com (mailing list archive)
State New, archived
Headers show
Series [kvm-unit-tests] Makefile: Compile the kvm-unit-tests with -fno-strict-aliasing | expand

Commit Message

Thomas Huth Jan. 22, 2020, 3:23 p.m. UTC
Strict aliasing bugs are often hard to find and understand (when the compiler
did not omit a warning), and kvm-unit-tests are mainly written by kernel
developers who are used to compile their code with -fno-strict-aliasing. So
let's use this flag for the kvm-unit-tests, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Hildenbrand Jan. 22, 2020, 3:28 p.m. UTC | #1
On 22.01.20 16:23, Thomas Huth wrote:
> Strict aliasing bugs are often hard to find and understand (when the compiler
> did not omit a warning), and kvm-unit-tests are mainly written by kernel
> developers who are used to compile their code with -fno-strict-aliasing. So
> let's use this flag for the kvm-unit-tests, too.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 4c716da..3834a12 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -49,7 +49,7 @@ include $(SRCDIR)/$(TEST_DIR)/Makefile
>  cc-option = $(shell if $(CC) -Werror $(1) -S -o /dev/null -xc /dev/null \
>                > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
>  
> -COMMON_CFLAGS += -g $(autodepend-flags)
> +COMMON_CFLAGS += -g $(autodepend-flags) -fno-strict-aliasing
>  COMMON_CFLAGS += -Wall -Wwrite-strings -Wempty-body -Wuninitialized
>  COMMON_CFLAGS += -Wignored-qualifiers -Werror

Acked-by: David Hildenbrand <david@redhat.com>
Paolo Bonzini Jan. 22, 2020, 3:30 p.m. UTC | #2
On 22/01/20 16:28, David Hildenbrand wrote:
> Acked-by: David Hildenbrand <david@redhat.com>

I think you meat Reviewed :)  Applied, thanks.

Paolo
David Hildenbrand Jan. 22, 2020, 3:33 p.m. UTC | #3
On 22.01.20 16:30, Paolo Bonzini wrote:
> On 22/01/20 16:28, David Hildenbrand wrote:
>> Acked-by: David Hildenbrand <david@redhat.com>
> 
> I think you meat Reviewed :)  Applied, thanks.

Yeah, whatever works for you ;)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 4c716da..3834a12 100644
--- a/Makefile
+++ b/Makefile
@@ -49,7 +49,7 @@  include $(SRCDIR)/$(TEST_DIR)/Makefile
 cc-option = $(shell if $(CC) -Werror $(1) -S -o /dev/null -xc /dev/null \
               > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
 
-COMMON_CFLAGS += -g $(autodepend-flags)
+COMMON_CFLAGS += -g $(autodepend-flags) -fno-strict-aliasing
 COMMON_CFLAGS += -Wall -Wwrite-strings -Wempty-body -Wuninitialized
 COMMON_CFLAGS += -Wignored-qualifiers -Werror