[cfe-commits] r89455 - /cfe/trunk/tools/driver/driver.cpp
Benjamin Kramer
benny.kra at googlemail.com
Fri Nov 20 03:49:06 PST 2009
Author: d0k
Date: Fri Nov 20 05:49:06 2009
New Revision: 89455
URL: http://llvm.org/viewvc/llvm-project?rev=89455&view=rev
Log:
Add a workaround to silence a bogus g++-4.4 -pedantic warning.
driver.cpp:211: warning: ISO C++ forbids zero-size array 'argv'
Modified:
cfe/trunk/tools/driver/driver.cpp
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=89455&r1=89454&r2=89455&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Fri Nov 20 05:49:06 2009
@@ -208,7 +208,9 @@
//
// 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;
More information about the cfe-commits
mailing list