1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

Enable -Wduplicated-branches, and -Wduplicated-cond.

This commit is contained in:
David Steele 2018-08-05 08:35:18 -04:00
parent 14f21a8f6c
commit 31167d8f98
2 changed files with 3 additions and 3 deletions

View File

@ -94,7 +94,7 @@
</release-item>
<release-item>
<p>Enable <id>-Wstrict-prototypes</id> and <id>-Wpointer-arith</id> and update code to conform.</p>
<p>Enable <id>-Wstrict-prototypes</id>, <id>-Wpointer-arith</id>, <id>-Wduplicated-branches</id>, and <id>-Wduplicated-cond</id> and update code to conform.</p>
</release-item>
<release-item>

View File

@ -364,14 +364,14 @@ sub run
"CFLAGS=-I. -std=c99 -fPIC -g" . ($self->{bProfile} ? " -pg" : '') . "\\\n" .
" -Werror -Wfatal-errors -Wall -Wextra -Wwrite-strings -Wno-clobbered -Wswitch-enum -Wconversion \\\n" .
($self->{oTest}->{&TEST_VM} eq VM_U16 || $self->{oTest}->{&TEST_VM} eq VM_U18 ?
" -Wformat-signedness \\\n" : '') .
" -Wformat-signedness -Wduplicated-branches -Wduplicated-cond \\\n" : '') .
# This warning appears to be broken on U12 even though the functionality is fine
($self->{oTest}->{&TEST_VM} eq VM_U12 || $self->{oTest}->{&TEST_VM} eq VM_CO6 ?
" -Wno-missing-field-initializers \\\n" : '') .
# ($self->{oTest}->{&TEST_VM} ne VM_CO6 && $self->{oTest}->{&TEST_VM} ne VM_U12 &&
# $self->{oTest}->{&TEST_MODULE} ne 'perl' && $self->{oTest}->{&TEST_NAME} ne 'exec' ?
# " -Wpedantic \\\n" : '') .
" -Wformat=2 -Wformat-nonliteral -Wstrict-prototypes -Wpointer-arith\\\n" .
" -Wformat=2 -Wformat-nonliteral -Wstrict-prototypes -Wpointer-arith \\\n" .
" `perl -MExtUtils::Embed -e ccopts`\n" .
"LDFLAGS=-lcrypto" . (vmCoverage($self->{oTest}->{&TEST_VM}) && $self->{bCoverageUnit} ? " -lgcov" : '') .
(vmWithBackTrace($self->{oTest}->{&TEST_VM}) && $self->{bBackTrace} ? ' -lbacktrace' : '') .