Skip to content

Commit 7c1526b

Browse files
committed
test.cpp: mitigated compiler warnings about missing return with GCC and Visual Studio
1 parent e6c4acf commit 7c1526b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ static const char* inputString(Input input) {
5858
case Input::CharBuffer:
5959
return "CharBuffer";
6060
}
61+
return ""; // unreachable - needed for GCC and Visual Studio
6162
}
6263

6364
static int assertEquals(const std::string &expected, const std::string &actual, int line)
@@ -110,6 +111,8 @@ static simplecpp::TokenList makeTokenList(const char code[], std::size_t size, s
110111
case Input::CharBuffer:
111112
return {{code, size}, filenames, filename, outputList};
112113
}
114+
115+
return simplecpp::TokenList{filenames}; // unreachable - needed for GCC and Visual Studio
113116
}
114117

115118
static simplecpp::TokenList makeTokenList(const char code[], std::vector<std::string> &filenames, const std::string &filename=std::string(), simplecpp::OutputList *outputList=nullptr)

0 commit comments

Comments
 (0)