Skip to content

Commit 9f21f84

Browse files
authored
added make target check-nonneg / generate (and fixed) all warnings in NONNEG build (#7747)
1 parent cb153f9 commit 9f21f84

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

.github/workflows/CI-unixish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ jobs:
241241
242242
- name: Check syntax with NONNEG
243243
run: |
244-
ls lib/*.cpp | xargs -n 1 -P $(nproc) g++ -fsyntax-only -std=c++0x -Ilib -Iexternals -Iexternals/picojson -Iexternals/simplecpp -Iexternals/tinyxml2 -DNONNEG
244+
make check-nonneg
245245
246246
build_cmake_boost:
247247

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,9 @@ checkCWEEntries: /tmp/errorlist.xml
453453
.PHONY: validateRules
454454
validateRules:
455455
xmllint --noout rules/*.xml
456+
.PHONY: check-nonneg
457+
check-nonneg:
458+
ls lib/*.cpp | xargs -n 1 -P $$(nproc) g++ -fsyntax-only -DNONNEG $(CXXFLAGS) $(INCLUDE_FOR_LIB)
456459

457460
###### Build
458461

lib/astutils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static int getArgumentPos(const Token* ftok, const Token* tokToFind){
109109
}
110110

111111
template<class T, class OuputIterator, REQUIRES("T must be a Token class", std::is_convertible<T*, const Token*> )>
112-
static void astFlattenCopy(T* tok, const char* op, OuputIterator out, nonneg int depth = 100)
112+
static void astFlattenCopy(T* tok, const char* op, OuputIterator out, int depth = 100)
113113
{
114114
--depth;
115115
if (!tok || depth < 0)

tools/dmake/dmake.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,10 @@ int main(int argc, char **argv)
867867
fout << ".PHONY: validateRules\n";
868868
fout << "validateRules:\n";
869869
fout << "\txmllint --noout rules/*.xml\n";
870+
fout << ".PHONY: check-nonneg\n";
871+
fout << "check-nonneg:\n";
872+
// TODO: how to use provided number of jobs?
873+
fout << "\tls lib/*.cpp | xargs -n 1 -P $$(nproc) g++ -fsyntax-only -DNONNEG $(CXXFLAGS) $(INCLUDE_FOR_LIB)\n";
870874

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

0 commit comments

Comments
 (0)