comparison clang/lib/Basic/Warnings.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children
comparison
equal deleted inserted replaced
173:0572611fdcc8 207:2e18cbf3894f
128 } 128 }
129 continue; 129 continue;
130 } 130 }
131 131
132 // -Werror/-Wno-error is a special case, not controlled by the option 132 // -Werror/-Wno-error is a special case, not controlled by the option
133 // table. It also has the "specifier" form of -Werror=foo and -Werror-foo. 133 // table. It also has the "specifier" form of -Werror=foo. GCC supports
134 // the deprecated -Werror-implicit-function-declaration which is used by
135 // a few projects.
134 if (Opt.startswith("error")) { 136 if (Opt.startswith("error")) {
135 StringRef Specifier; 137 StringRef Specifier;
136 if (Opt.size() > 5) { // Specifier must be present. 138 if (Opt.size() > 5) { // Specifier must be present.
137 if ((Opt[5] != '=' && Opt[5] != '-') || Opt.size() == 6) { 139 if (Opt[5] != '=' &&
140 Opt.substr(5) != "-implicit-function-declaration") {
138 if (Report) 141 if (Report)
139 Diags.Report(diag::warn_unknown_warning_specifier) 142 Diags.Report(diag::warn_unknown_warning_specifier)
140 << "-Werror" << ("-W" + OrigOpt.str()); 143 << "-Werror" << ("-W" + OrigOpt.str());
141 continue; 144 continue;
142 } 145 }