File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,15 @@ void Check::reportError(const ErrorLogger::ErrorMessage &errmsg)
4343 std::cout << errmsg.toXML (true , 1 ) << std::endl;
4444}
4545
46- std::list<Check *> &Check::instances () {
46+ std::list<Check *> &Check::instances ()
47+ {
4748#ifdef __SVR4
48- // Under Solaris, destructors are called in wrong order which causes a segmentation fault.
49- // This fix ensures pointer remains valid and reachable until program terminates.
50- static std::list<Check *> *_instances= new std::list<Check *>;
51- return *_instances;
49+ // Under Solaris, destructors are called in wrong order which causes a segmentation fault.
50+ // This fix ensures pointer remains valid and reachable until program terminates.
51+ static std::list<Check *> *_instances= new std::list<Check *>;
52+ return *_instances;
5253#else
53- static std::list<Check *> _instances;
54- return _instances;
54+ static std::list<Check *> _instances;
55+ return _instances;
5556#endif
56- }
57+ }
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ class CPPCHECKLIB Check {
5353 }
5454
5555 /* * List of registered check classes. This is used by Cppcheck to run checks and generate documentation */
56- static std::list<Check *> &instances ();
56+ static std::list<Check *> &instances ();
5757
5858 /* * run checks, the token list is not simplified */
5959 virtual void runChecks (const Tokenizer *, const Settings *, ErrorLogger *) {
You can’t perform that action at this time.
0 commit comments