Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI-unixish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ jobs:

- name: Check syntax with NONNEG
run: |
ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG
make check-nonneg

build_cmake_boost:

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@ checkCWEEntries: /tmp/errorlist.xml
.PHONY: validateRules
validateRules:
xmllint --noout rules/*.xml
.PHONY: check-nonneg
check-nonneg:
ls lib/*.cpp | xargs -n 1 -P $$(nproc) g++ -fsyntax-only -DNONNEG $(CXXFLAGS) $(INCLUDE_FOR_LIB)

###### Build

Expand Down
2 changes: 1 addition & 1 deletion lib/astutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static int getArgumentPos(const Token* ftok, const Token* tokToFind){
}

template<class T, class OuputIterator, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
static void astFlattenCopy(T* tok, const char* op, OuputIterator out, nonneg int depth = 100)
static void astFlattenCopy(T* tok, const char* op, OuputIterator out, int depth = 100)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spontanously I would have changed the code instead so it can't be negative.. but it doesn't matter much. I can accept this.

{
--depth;
if (!tok || depth < 0)
Expand Down
4 changes: 4 additions & 0 deletions tools/dmake/dmake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,10 @@ int main(int argc, char **argv)
fout << ".PHONY: validateRules\n";
fout << "validateRules:\n";
fout << "\txmllint --noout rules/*.xml\n";
fout << ".PHONY: check-nonneg\n";
fout << "check-nonneg:\n";
// TODO: how to use provided number of jobs?
fout << "\tls lib/*.cpp | xargs -n 1 -P $$(nproc) g++ -fsyntax-only -DNONNEG $(CXXFLAGS) $(INCLUDE_FOR_LIB)\n";

fout << "\n###### Build\n\n";

Expand Down
Loading