From 8af24ee7834dac8a2ba73aa8023ad8d475583742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 20 Jul 2007 06:18:33 +0000 Subject: [PATCH] Always give a warning when 'memset' is used upon a class --- CheckClass.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CheckClass.cpp b/CheckClass.cpp index 242ded9ba..5ebc72245 100644 --- a/CheckClass.cpp +++ b/CheckClass.cpp @@ -418,19 +418,15 @@ void CheckMemset() if (!(type && type[0])) continue; - // It will be assumed that memset can be used upon 'this'. - // Todo: Check this too - if (strcmp(getstr(tok,2),"this") == 0) - continue; - // Warn if type is a class.. const char *pattern1[] = {"class","",NULL}; pattern1[1] = type; - if (findtoken(tokens,pattern1)) + if (strcmp("this",getstr(tok,2))==0 || findtoken(tokens,pattern1)) { std::ostringstream ostr; ostr << FileLine(tok) << ": Using 'memset' on class."; ReportErr(ostr.str()); + continue; } // Warn if type is a struct that contains any std::*