summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/OptTable.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-13 21:50:47 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-13 21:50:47 +0000
commit9ab53d2b173f664cd352eead6321572a9d6d4c83 (patch)
treeafa9f6c1d5b94eb638340e39a1c0eabcf0cb2853 /clang/lib/Driver/OptTable.cpp
parent48b4d1e27eb1b5b6454f24b4ef249baa45385ae8 (diff)
downloadbcm5719-llvm-9ab53d2b173f664cd352eead6321572a9d6d4c83.tar.gz
bcm5719-llvm-9ab53d2b173f664cd352eead6321572a9d6d4c83.zip
Explicitly initialize the options array, MinGW's gcc 4.3.5 appears to have a bug
in array value-initialization. llvm-svn: 75518
Diffstat (limited to 'clang/lib/Driver/OptTable.cpp')
-rw-r--r--clang/lib/Driver/OptTable.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Driver/OptTable.cpp b/clang/lib/Driver/OptTable.cpp
index 7ea6a8b0d9f..8c885757645 100644
--- a/clang/lib/Driver/OptTable.cpp
+++ b/clang/lib/Driver/OptTable.cpp
@@ -91,7 +91,11 @@ static Info &getInfo(unsigned id) {
return OptionInfos[id - 1];
}
-OptTable::OptTable() : Options(new Option*[numOptions]()) {
+OptTable::OptTable() : Options(new Option*[numOptions]) {
+ // Explicitly zero initialize the error to work around a bug in array
+ // value-initialization on MinGW with gcc 4.3.5.
+ memset(Options, 0, sizeof(*Options) * numOptions);
+
// Find start of normal options.
FirstSearchableOption = 0;
for (unsigned i = OPT_UNKNOWN + 1; i < LastOption; ++i) {
OpenPOWER on IntegriCloud