CI: Update CppCheck 2.1 (#1440)

This commit is contained in:
Olivier
2020-08-21 19:41:32 +02:00
committed by GitHub
parent 46f0e961cc
commit 15f5c5e793
5 changed files with 10 additions and 12 deletions

View File

@@ -92,7 +92,7 @@ One or more required tools not found. Install required tools and re-run .mystoo
To finish the bootstrap process, you will need to install the required
tools for your specific operating system as follows. Currently we use
Astyle 3.1 or later and Cppcheck 1.88 or later. Once you have
Astyle 3.1 or later and Cppcheck 2.1 or later. Once you have
installed AStyle and Cppcheck, re-run bootstrap-dev.sh to finish
configuring your development environment.
@@ -114,7 +114,7 @@ Tested with Ubuntu 18-04 LTS and 19.04
apt-get install astyle
git clone https://github.com/danmar/cppcheck.git
cd cppcheck/
git checkout 1.89 # or later version if available
git checkout 2.1 # or later version if available
mkdir build && cd build && cmake .. && cmake --build .
sudo make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function" install
```
@@ -137,16 +137,13 @@ mv .\astyle.3.1.zip\AStyle 'C:\Program Files\AStyle'
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\AStyle\bin")
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\AStyle\bin", [EnvironmentVariableTarget]::Machine)
### Install Cppcheck (either 64-bit or 32-bit depending upon your version of Windows - pick one below)
### Install Cppcheck x64
# 64-bit
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
# 32-bit
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
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
# Launch installer to install Cppcheck
& .\cppcheck-1.88-Setup.msi
& .\cppcheck-2.1-x64-Setup.msi
### Add Cppcheck to your path
[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
```
git clone https://github.com/danmar/cppcheck.git
cd cppcheck/
git checkout 1.89 # or later version if available)
git checkout 2.1 # or later version if available)
mkdir build && cd build && cmake .. && cmake --build .
sudo make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function" install
```

View File

@@ -75,7 +75,7 @@ check_git_remote "upstream" "${mysrepo}" || {
#3
log "Checking tool/utility prerequisites..."
check_tool_prerequisite "astyle" "3.1" || err "Install AStyle 3.1 or greater and re-run ${0}"
check_tool_prerequisite "cppcheck" "1.88" || err "Install Cppcheck 1.88 or greater and re-run ${0}"
check_tool_prerequisite "cppcheck" "2.1" || err "Install Cppcheck 2.1 or greater and re-run ${0}"
check_tool_prerequisite "git" "2.0" || err "Install git 2.0 or greater and re-run ${0}"
#4

View File

@@ -107,6 +107,7 @@ static uint8_t swi_receive_bytes(uint8_t count, uint8_t *buffer)
}
}
//cppcheck-suppress knownConditionTrueFalse
if (timeout_count == 0) {
status = SWI_FUNCTION_RETCODE_TIMEOUT;
break;

View File

@@ -169,7 +169,7 @@ uint8_t atsha204Class::swi_receive_bytes(uint8_t count, uint8_t *buffer)
break;
}
}
//cppcheck-suppress knownConditionTrueFalse
if (timeout_count == 0) {
status = SWI_FUNCTION_RETCODE_TIMEOUT;
break;

View File

@@ -748,7 +748,7 @@ LOCAL bool RFM69_isModeReady(void)
uint16_t timeout = 0xFFFF;
while (!(RFM69_readReg(RFM69_REG_IRQFLAGS1) & RFM69_IRQFLAGS1_MODEREADY) && timeout--) {
};
return timeout;
return (bool)timeout;
}
LOCAL void RFM69_encrypt(const char *key)