/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
void FopenUsageChecker::check(const MatchFinder::MatchResult &Result) { const CallExpr *FuncCall = Result.Nodes.getNodeAs<CallExpr>("funcCall"); staticconstchar *ExtraInfo = "On Windows executed functions: fopen, fopen_s, open, _open, _sopen, " "_sopen_s, OpenFile, CreateFileA should never be used due to lossy " "conversion from UTF8 to ANSI.";
if (FuncCall) {
diag(FuncCall->getBeginLoc(), "Usage of ASCII file functions (here %0) is forbidden on Windows.",
DiagnosticIDs::Warning)
<< FuncCall->getDirectCallee()->getName();
diag(FuncCall->getBeginLoc(), ExtraInfo, DiagnosticIDs::Note);
}
}
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.