From: Benjamin Kramer Date: Fri, 20 Nov 2009 11:49:06 +0000 (+0000) Subject: Add a workaround to silence a bogus g++-4.4 -pedantic warning. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5dc9f34ef2288ace0003e1fee011cc9e7d2d040;p=clang Add a workaround to silence a bogus g++-4.4 -pedantic warning. driver.cpp:211: warning: ISO C++ forbids zero-size array 'argv' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89455 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp index dbfc293655..c69b29c1ed 100644 --- a/tools/driver/driver.cpp +++ b/tools/driver/driver.cpp @@ -208,7 +208,9 @@ int main(int argc, const char **argv) { // // Note that we intentionally want to use argv[0] here, to support "clang++" // being a symlink. - std::string ProgName(llvm::sys::Path(argv[0]).getBasename()); + // + // We use *argv instead of argv[0] to work around a bogus g++ warning. + std::string ProgName(llvm::sys::Path(*argv).getBasename()); if (llvm::StringRef(ProgName).endswith("++") || llvm::StringRef(ProgName).rsplit('-').first.endswith("++")) TheDriver.CCCIsCXX = true;