Skip to content

Commit 15f5c5e

Browse files
authored
CI: Update CppCheck 2.1 (#1440)
1 parent 46f0e96 commit 15f5c5e

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

.mystools/README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ One or more required tools not found. Install required tools and re-run .mystoo
9292

9393
To finish the bootstrap process, you will need to install the required
9494
tools for your specific operating system as follows. Currently we use
95-
Astyle 3.1 or later and Cppcheck 1.88 or later. Once you have
95+
Astyle 3.1 or later and Cppcheck 2.1 or later. Once you have
9696
installed AStyle and Cppcheck, re-run bootstrap-dev.sh to finish
9797
configuring your development environment.
9898

@@ -114,7 +114,7 @@ Tested with Ubuntu 18-04 LTS and 19.04
114114
apt-get install astyle
115115
git clone https://github.com/danmar/cppcheck.git
116116
cd cppcheck/
117-
git checkout 1.89 # or later version if available
117+
git checkout 2.1 # or later version if available
118118
mkdir build && cd build && cmake .. && cmake --build .
119119
sudo make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function" install
120120
```
@@ -137,16 +137,13 @@ mv .\astyle.3.1.zip\AStyle 'C:\Program Files\AStyle'
137137
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\AStyle\bin")
138138
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\AStyle\bin", [EnvironmentVariableTarget]::Machine)
139139
140-
### Install Cppcheck (either 64-bit or 32-bit depending upon your version of Windows - pick one below)
140+
### Install Cppcheck x64
141141
142142
# 64-bit
143-
iwr 'https://github.com/danmar/cppcheck/releases/download/1.88/cppcheck-1.88-x64-Setup.msi' -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox -OutFile cppcheck-1.88-Setup.msi
144-
145-
# 32-bit
146-
iwr 'https://github.com/danmar/cppcheck/releases/download/1.88/cppcheck-1.88-x86-Setup.msi' -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox -OutFile cppcheck-1.88-Setup.msi
143+
iwr 'https://github.com/danmar/cppcheck/releases/download/2.1/cppcheck-2.1-x64-Setup.msi' -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox -OutFile cppcheck-2.1-x64-Setup.msi
147144
148145
# Launch installer to install Cppcheck
149-
& .\cppcheck-1.88-Setup.msi
146+
& .\cppcheck-2.1-x64-Setup.msi
150147
151148
### Add Cppcheck to your path
152149
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Cppcheck", [EnvironmentVariableTarget]::Machine)
@@ -174,7 +171,7 @@ cd astyle/build/gcc && sudo make shared release shared static install
174171
```
175172
git clone https://github.com/danmar/cppcheck.git
176173
cd cppcheck/
177-
git checkout 1.89 # or later version if available)
174+
git checkout 2.1 # or later version if available)
178175
mkdir build && cd build && cmake .. && cmake --build .
179176
sudo make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function" install
180177
```

.mystools/bootstrap-dev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ check_git_remote "upstream" "${mysrepo}" || {
7575
#3
7676
log "Checking tool/utility prerequisites..."
7777
check_tool_prerequisite "astyle" "3.1" || err "Install AStyle 3.1 or greater and re-run ${0}"
78-
check_tool_prerequisite "cppcheck" "1.88" || err "Install Cppcheck 1.88 or greater and re-run ${0}"
78+
check_tool_prerequisite "cppcheck" "2.1" || err "Install Cppcheck 2.1 or greater and re-run ${0}"
7979
check_tool_prerequisite "git" "2.0" || err "Install git 2.0 or greater and re-run ${0}"
8080

8181
#4

drivers/ATSHA204/ATSHA204.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ static uint8_t swi_receive_bytes(uint8_t count, uint8_t *buffer)
107107
}
108108
}
109109

110+
//cppcheck-suppress knownConditionTrueFalse
110111
if (timeout_count == 0) {
111112
status = SWI_FUNCTION_RETCODE_TIMEOUT;
112113
break;

examples/SecurityPersonalizer/sha204_library.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ uint8_t atsha204Class::swi_receive_bytes(uint8_t count, uint8_t *buffer)
169169
break;
170170
}
171171
}
172-
172+
//cppcheck-suppress knownConditionTrueFalse
173173
if (timeout_count == 0) {
174174
status = SWI_FUNCTION_RETCODE_TIMEOUT;
175175
break;

hal/transport/RFM69/driver/new/RFM69_new.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ LOCAL bool RFM69_isModeReady(void)
748748
uint16_t timeout = 0xFFFF;
749749
while (!(RFM69_readReg(RFM69_REG_IRQFLAGS1) & RFM69_IRQFLAGS1_MODEREADY) && timeout--) {
750750
};
751-
return timeout;
751+
return (bool)timeout;
752752
}
753753

754754
LOCAL void RFM69_encrypt(const char *key)

0 commit comments

Comments
 (0)