There is a supposedly platform-specific crash related to not recognising
the availability of *Annex K.* properly? This patch is an attempt for
fixing this by moving the reset logic for the cache to a different
place.
It's really a coin-flip at this point whether this is really a fix...
const SourceManager &SM, Preprocessor *PP,
Preprocessor * /*ModuleExpanderPP*/) {
this->PP = PP;
-}
-
-void UnsafeFunctionsCheck::onEndOfTranslationUnit() {
- this->PP = nullptr;
IsAnnexKAvailable.reset();
}
void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP,
Preprocessor *ModuleExpanderPP) override;
- void onEndOfTranslationUnit() override;
private:
/// If true, additional functions from widely used API-s (such as POSIX) are
void f1(char *S) {
gets(S);
- // CHECK-MESSAGES-WITH-ANNEX-K: :[[@LINE-1]]:3: warning: function 'gets' is insecure, was deprecated and removed in C11 and C++14; 'gets_s' should be used instead
- // CHECK-MESSAGES-WITH-ANNEX-K-CERT-ONLY: :[[@LINE-2]]:3: warning: function 'gets' is insecure, was deprecated and removed in C11 and C++14; 'gets_s' should be used instea
+ // CHECK-MESSAGES-WITH-ANNEX-K: :[[@LINE-1]]:3: warning: function 'gets' is insecure, was deprecated and removed in C11 and C++14; 'gets_s' should be used instead [bugprone-unsafe-functions]
+ // CHECK-MESSAGES-WITH-ANNEX-K-CERT-ONLY: :[[@LINE-2]]:3: warning: function 'gets' is insecure, was deprecated and removed in C11 and C++14; 'gets_s' should be used instead
// CHECK-MESSAGES-WITHOUT-ANNEX-K: :[[@LINE-3]]:3: warning: function 'gets' is insecure, was deprecated and removed in C11 and C++14; 'fgets' should be used instead
strlen(S);