Fix crash on Windows with -j option (#4229)

* Fix crash on Windows with -j option

* Disable CI-cygwin workflow

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Try to fix Cygwin build

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Update CI-cygwin.yml

* Cygwin uses THREADING_MODEL_FORK

* Restore workflows

* Remove comment

* Fix dmake

* Fix #11179 FP invalidFunctionArgStr

* Revert "Fix #11179 FP invalidFunctionArgStr"

This reverts commit dd5d3e67c6.
This commit is contained in:
chrchr-github 2022-07-13 13:46:03 +02:00 committed by GitHub
parent b387ae80f1
commit 21d992cc00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 14 deletions

View File

@ -16,6 +16,10 @@ jobs:
matrix: matrix:
os: [windows-2019] os: [windows-2019]
arch: [x64, x86] arch: [x64, x86]
include:
- platform: 'x86_64'
packages: |
gcc-g++
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -24,26 +28,27 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Cygwin - name: Set up Cygwin
uses: egor-tensin/setup-cygwin@v3 uses: cygwin/cygwin-install-action@master
with: with:
platform: ${{ matrix.arch }} platform: ${{ matrix.arch }}
packages: ${{ matrix.packages }}
- name: Build cppcheck - name: Build cppcheck
run: | run: |
C:\tools\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make -j2 C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make -j2
- name: Build test - name: Build test
run: | run: |
C:\tools\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make -j2 testrunner C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make -j2 testrunner
- name: Run test - name: Run test
run: | run: |
C:\tools\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make -j2 check C:\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% && make -j2 check
- name: Extra test for misra - name: Extra test for misra
run: | run: |
C:\tools\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE%\addons\test cd %GITHUB_WORKSPACE%\addons\test
..\..\cppcheck --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64 && python3 ..\misra.py -verify misra\misra-test.c.dump ..\..\cppcheck.exe --dump -DDUMMY --suppress=uninitvar --inline-suppr misra\misra-test.c --std=c89 --platform=unix64
C:\tools\cygwin\bin\bash.exe -l -c cd %GITHUB_WORKSPACE% python3 ..\misra.py -verify misra\misra-test.c.dump
.\cppcheck --addon=misra --inline-suppr --enable=information --error-exitcode=1 addons\test\misra\misra-ctu-*-test.c ..\..\cppcheck.exe --addon=misra --inline-suppr --enable=information --error-exitcode=1 misra\misra-ctu-1-test.c misra\misra-ctu-2-test.c

View File

@ -102,7 +102,7 @@ ifndef CXXFLAGS
endif endif
ifeq (g++, $(findstring g++,$(CXX))) ifeq (g++, $(findstring g++,$(CXX)))
override CXXFLAGS += -std=c++0x override CXXFLAGS += -std=gnu++0x
else ifeq (clang++, $(findstring clang++,$(CXX))) else ifeq (clang++, $(findstring clang++,$(CXX)))
override CXXFLAGS += -std=c++0x override CXXFLAGS += -std=c++0x
else ifeq ($(CXX), c++) else ifeq ($(CXX), c++)

View File

@ -18,7 +18,7 @@
#include "processexecutor.h" #include "processexecutor.h"
#if !defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) #if !defined(WIN32) && !defined(__MINGW32__)
#include "color.h" #include "color.h"
#include "config.h" #include "config.h"

View File

@ -110,7 +110,7 @@ static const std::string emptyString;
#elif defined(USE_THREADS) #elif defined(USE_THREADS)
#define THREADING_MODEL_THREAD #define THREADING_MODEL_THREAD
#define STDCALL #define STDCALL
#elif ((defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__) && !defined(__CYGWIN__)) || defined(__CPPCHECK__) #elif ((defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__)) || defined(__CPPCHECK__)
#define THREADING_MODEL_FORK #define THREADING_MODEL_FORK
#define STDCALL #define STDCALL
#else #else

View File

@ -1367,7 +1367,7 @@ ValueFlow::Value evaluateLibraryFunction(const std::unordered_map<nonneg int, Va
const std::string& returnValue, const std::string& returnValue,
const Settings* settings) const Settings* settings)
{ {
static std::unordered_map<std::string, thread_local static std::unordered_map<std::string,
std::function<ValueFlow::Value(const std::unordered_map<nonneg int, ValueFlow::Value>& arg)>> std::function<ValueFlow::Value(const std::unordered_map<nonneg int, ValueFlow::Value>& arg)>>
functions = {}; functions = {};
if (functions.count(returnValue) == 0) { if (functions.count(returnValue) == 0) {

View File

@ -374,7 +374,7 @@ int main(int argc, char **argv)
} }
fout << "ifeq (g++, $(findstring g++,$(CXX)))\n" fout << "ifeq (g++, $(findstring g++,$(CXX)))\n"
<< " override CXXFLAGS += -std=c++0x\n" << " override CXXFLAGS += -std=gnu++0x\n"
<< "else ifeq (clang++, $(findstring clang++,$(CXX)))\n" << "else ifeq (clang++, $(findstring clang++,$(CXX)))\n"
<< " override CXXFLAGS += -std=c++0x\n" << " override CXXFLAGS += -std=c++0x\n"
<< "else ifeq ($(CXX), c++)\n" << "else ifeq ($(CXX), c++)\n"