Skip to contentSkip to conversation

configure: Make -Waddress-of-packed-member warnings be errors

PATCH Applied Peter Maydell 4 participants 4 messages Feb 8, 2019 – Feb 14, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: Make -Waddress-of-packed-member warnings be errors

We have now managed to eradicate all the places in the codebase that triggered clang's -Waddress-of-packed-member warning. Remove the compiler flag that exempted it from our usual -Werror policy. This will prevent any new problematic code being added in future.

---
 configure | 1 -
 1 file changed, 1 deletion(-)
configure +0 -1
index fbd0825488c..50ac5d90f2e 100755
@@ -1881,7 +1881,6 @@ gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
 gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
 gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags"
 gcc_flags="-Wno-string-plus-int $gcc_flags"
-gcc_flags="-Wno-error=address-of-packed-member $gcc_flags"
 # Note that we do not add -Werror to gcc_flags here, because that would
 # enable it for all configure tests. If a configure test failed due
 # to -Werror this would just silently disable some features,
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Peter Maydell

We have now managed to eradicate all the places in the codebase that triggered clang's -Waddress-of-packed-member warning. Remove the compiler flag that exempted it from our usual -Werror policy. This will prevent any new problematic code being added in future.

---
 configure | 1 -
 1 file changed, 1 deletion(-)
configure +0 -0
index fbd0825488c..50ac5d90f2e 100755

configure gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" · line 1886

Quoted 7 lines
configure +0 -1
@@ -1881,7 +1881,6 @@ gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
 gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
 gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags"
 gcc_flags="-Wno-string-plus-int $gcc_flags"
-gcc_flags="-Wno-error=address-of-packed-member $gcc_flags"
 # Note that we do not add -Werror to gcc_flags here, because that would
 # enable it for all configure tests. If a configure test failed due
 # to -Werror this would just silently disable some features,

Great!

#2 lore raw
Quoted 26 lines · Thomas Huth
Quoted 15 lines · Peter Maydell

We have now managed to eradicate all the places in the codebase that triggered clang's -Waddress-of-packed-member warning. Remove the compiler flag that exempted it from our usual -Werror policy. This will prevent any new problematic code being added in future.

---
 configure | 1 -
 1 file changed, 1 deletion(-)
configure +0 -0
index fbd0825488c..50ac5d90f2e 100755

configure gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" · line 1886

Quoted 7 lines
configure +0 -1
@@ -1881,7 +1881,6 @@ gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
 gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
 gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags"
 gcc_flags="-Wno-string-plus-int $gcc_flags"
-gcc_flags="-Wno-error=address-of-packed-member $gcc_flags"
 # Note that we do not add -Werror to gcc_flags here, because that would
 # enable it for all configure tests. If a configure test failed due
 # to -Werror this would just silently disable some features,

Great!

Quoted 2 lines

Applied to my trivial-patches branch.

Thanks,
Laurent

Reviewed-by on v1 1/1
#3 lore raw
In reply to Peter Maydell
Quoted 4 lines · Peter Maydell

We have now managed to eradicate all the places in the codebase that triggered clang's -Waddress-of-packed-member warning. Remove the compiler flag that exempted it from our usual -Werror policy. This will prevent any new problematic code being added in future.

Yay!

Quoted 2 lines
Quoted 17 lines
---
 configure | 1 -
 1 file changed, 1 deletion(-)
configure +0 -1
index fbd0825488c..50ac5d90f2e 100755
@@ -1881,7 +1881,6 @@ gcc_flags="-Wno-missing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
 gcc_flags="-Wendif-labels -Wno-shift-negative-value $gcc_flags"
 gcc_flags="-Wno-initializer-overrides -Wexpansion-to-defined $gcc_flags"
 gcc_flags="-Wno-string-plus-int $gcc_flags"
-gcc_flags="-Wno-error=address-of-packed-member $gcc_flags"
 # Note that we do not add -Werror to gcc_flags here, because that would
 # enable it for all configure tests. If a configure test failed due
 # to -Werror this would just silently disable some features,