1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

Alternative (to r216344) fix of gcc -Wpedantic.

As suggested by David Blaikie, this may be easier to read.

The original warning was:

../tools/llvm-cov/llvm-cov.cpp:53:49: error: ISO C++ forbids zero-size array 'argv' [-Werror=pedantic]
       std::string Invocation(std::string(argv[0]) + " " + argv[1]);

It seems to be the case that GCC's warning gets confused and thinks
'argv' is a declaration here. GCC bugzilla issue #61259.

llvm-svn: 218048
This commit is contained in:
Patrik Hagglund 2014-09-18 11:52:57 +00:00
parent 79b1a240fa
commit b6dca8f929

View File

@ -50,7 +50,7 @@ int main(int argc, const char **argv) {
func = gcov_main;
if (func) {
std::string Invocation(std::string() + argv[0] + " " + argv[1]);
std::string Invocation = std::string(argv[0]) + " " + argv[1];
argv[1] = Invocation.c_str();
return func(argc - 1, argv + 1);
}