Index: lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp +++ lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp @@ -738,7 +738,7 @@ return; // Issue a warning. ArgIndex == -1: Deprecated but not unsafe (has size - // restrictions). + // restrictions), ArgIndex == -2: built-in functions, etc. enum { DEPR_ONLY = -1, UNKNOWN_CALL = -2 }; StringRef Name = FD->getIdentifier()->getName(); int ArgIndex = @@ -750,8 +750,7 @@ "memmove", "memset", "strncpy", "strncat", DEPR_ONLY) .Default(UNKNOWN_CALL); - assert(ArgIndex != UNKNOWN_CALL && "Unsupported function"); - bool BoundsProvided = ArgIndex == DEPR_ONLY; + bool BoundsProvided = ArgIndex < 0; if (!BoundsProvided) { // Currently we only handle (not wide) string literals. It is possible to do @@ -781,8 +780,12 @@ Out2 << "security checks introduced " "in the C11 standard. Replace with analogous functions that " - "support length arguments or provides boundary checks such as '" - << Name << "_s' in case of C11"; + "support length arguments or provides boundary checks"; + + // We know the function has a secure version introduced in C11. + if(ArgIndex != UNKNOWN_CALL) { + Out2 << " such as '" << Name << "_s' in case of C11"; + } PathDiagnosticLocation CELoc = PathDiagnosticLocation::createBegin(CE, BR.getSourceManager(), AC);