*************** Version 9.00i -- January 6, 2012 *************** * We were issuing a false positive #1764 for parameters which were references to arrays when those arrays experienced a deep modification. We have corrected this. * A class type that is not a specialization could succeed at template argument deduction against a dependent specialization, eventually leading to Internal Error, subcode 2040. Example: struct A { }; void f(const A & t); // #1 template class U> void f(const U & );// #2 void g() { A x; f(x); // ok (9.00h: Internal Error, subcode=2040 here) } GSRN-TM-110803-1 * An ill-formed class member definition in Microsoft's WTL sent us into infinite recursion during the second pass. We now abort the processing of ill-formed member-declarations much more gracefully. Example: struct A { virtual void f() = 0; }; struct B : public A { virtual void A::f(){} // Well-deserved Error 1040 here. }; * We now report on violations of MISRA C 1998 #62, MISRA C 2004 #15.3, and MISRA C++ #6-4-6, when the switch expression is of enumeration type. * We now detect assignment operators used in sub-expressions in violation of MISRA C++ rule 6-2-1. * We now issue warning #663, suspicious array to pointer conversion, for structure members arrays. * We now perform a more thorough analysis for violations of MISRA C++ rule #6-2-2 with respect to testing floating point variables for equality. * The use of -emacro() options were having trouble working when the macro was used inside a class member function; we have resolved this. * Introduced initial support for GCC attributes. Unless otherwise documented, GCC attributes will be ignored. Over time, we will implement support for specific attributes as demand and resources warrant. To err on the side of caution, we do not enable "__attribute__" as a reserved word by default. (Non-GCC compilers may use that spelling for a different form of attribute syntax.) Instead, we have endowed the semantics of GCC's __attribute__ in a reserved word that is spelled "__gcc_attribute__" and disabled by default. Support can be enabled with an option like this: -rw_asgn(__attribute__,__gcc_attribute__) * We now perform a more intelligent analysis with respect to unread values of reference parameters. * We were issuing diagnostics about violations of MISRA C 2004 rule #7.1, prohibiting the use of octal constants, before completing the expansion of macros. We now perform a more deliberate analysis. * We now perform a more accurate analysis with respect to variable values read within a switch statement. * In a context in which a member class of a class template is a "known" dependent type (i.e., dependent but not a member of an unknown specialization), we would erroneously regard the member class as "non-dependent" when used as a template argument. This led to attempts to instantiate dependent types, which led to other cascading errors. Example: template struct X { }; template struct A { struct B; struct C; }; template struct A::B : X {}; Here, we would attempt to instantiate X::C> (which is inappropriate). GSRN-TM-111007-1 * When an initializer for a C++2011 'auto' variable had a strong type, we did not use that strong type for type deduction; this led to undeserved strong type Warning messages. Example: //lint -strong(AcJdX,meters) typedef double meters; int main() { meters x = 2; // Ok auto y = x * x; // Undeserved Warning 663 here. // 663: Assignment from a strong type '(meters*meters)' in context: // initialization } (Note that type deduction for a function call must be done against the underlying type because a function template specialization can be called using arguments that have different strong types but the same underlying type.) GSRN-TM-111001-1 * We were inadvertently not treating library modules as library during module wrap-up time. This oversight has been corrected. * Introduced support for the GCC "mode" attribute * We did not recognize 'virtual' (implicit or explicit) as a trigger for the instantiation of a member of an instantiated class. Example: template struct B { virtual void f() { } }; B obj; // should trigger instantiation of B::f(). * We were unintentionally issuing diagnostics about violations of MISRA C++ rule #17-0-2 for created tags. We have corrected this. * A precision estimate for a call to a function containing a return semantic such as -sem( f, @n < 256 ) was off by one. The precision estimate (for unsigned quantities) in this case is now 8 rather than 9. * Our implementation of [dcl.init.ref] was out of date for the case of an Rvalue reference whose underlying type is reference-related to the type of an Lvalue initializer. Example: struct A {}; struct B { B(); }; void g( const B&, void*); // #1 void g( B&&, A* ); // #2 void f( B & q , A * p ) { g( q, p ); // Undeserved Error 1023 here // 1023: "Call 'g(B, struct A *)' is ambiguous" } This led to undeserved errors against certain uses of the Standard Library when using the implementation provided with Visual Studio 2010; example: #include #include void Error1023() { std::ifstream x("Dummy"); std::stringstream y; y << x.rdbuf(); // Undeserved Error 1023 here // for operator<<(). } GSRN-OV-111102-1 * Function templates were incorrectly considered as part of the +stack() analysis; this led to entries consisting only of "?" in the stack usage report. GSRN-TM-110719-3 * We now allow a braceless switch statement after being convinced of its ultimate utility. * We now properly interpret the following loop int a[10]; for( i = 10; i > 0; i-- ) a[i] = 0; and give the expected warning (661 out-of-bounds pointer) fixing a bug that had crept in with Vers. 8.00x * A problem with UTF-16 Little Endian has been fixed. * We did not handle the case of a GCC attribute-specifier immediately after the /identifier/ in a /namespace-definition/. Example: //lint -rw_asgn(__attribute__,__gcc_attribute__) namespace N __attribute__ ((__visibility__ ("default"))) // Ok { } * We now perform more accurate diagnoses with respect to external identifiers. * We have corrected a bug which caused Lint to complain of binary constants in a *.vcxproj file. * The size option -sw# is documented as only affecting the size of the built-in type wchar_t (if there is such a type) and not the size of the underlying type for the case where wchar_t is a typedef name; but the implementation actually affected the underlying type, leading us to think that sizeof(short)==4 after: -ss2 -sw4 GSRN-OP-111214-1 * We no longer issue an undeserved Note 975 for: /*lint +pragma(asm,off) +pragma(endasm,on) +e975 // For "unrecognized pragma" Note. */ void f(void) { #pragma asm SYS #8 #pragma endasm // Undeserved 975 here // 975: Unrecognized pragma 'endasm' will be ignored } GSRN-PP-111215-1 * We now provide a flag, +fci, to allow the application of the '_Complex' keyword in C99 to integer types. * We were issuing complaints about functions defined without prototypes in scope if those functions were declared inside an unnamed namespace. We now remain silent in such cases. * We now perform a more complete conversion of *.vcxproj file to Lint configuration information. *************** Version 9.00h -- July 26, 2011 *************** * Introduced support for alias templates for C++0x ALTE, 4/12/11 * In a function temploid definition we would trip over a function-try-block. Example: template void f(T) try { } catch // Undeserved Error 10 here // ("Expecting identifier or other declarator") (...) {} TFTB, 5/17/11 * The alignment of an empty class was assumed to be zero; it is now assumed to be 1. AEC1, 5/17/11 * We now refrain from issuing elective note #953 if the object is a variable with class or struct type and lacks a User-provided default constructor. NDCC, 5/17/11 * Added support for __asm as it is understood by ARMcc and WindRiver: 1) as a function specifier, syntactically similar to 'inline': __asm void h(void) { assembly code... } ... where Lint will see __asm as equivalent to '_ignore_init'. 2) as a lead in to a braced region containing in-line assembly code: __asm { ... assembly code ... } ... where Lint will see __asm as equivalent to '_up_to_brackets'. 3) as a way of decorating a variable with an alternative name: int n __asm("m"); Since different compilers treat this keyword in different ways, we don't want to "pollute" the existing semantics. So instead, we've introduced a new keyword supporting the uses described above. The spelling is __ARM_asm and users of ARM and WindRiver can enable it using: -rw_asgn(__asm,__ARM_asm) -rw_asgn(asm,__ARM_asm) GSRN-SC-100608-2 AKAR, 5/20/11 * During header bypassing, entities with internal linkage were not properly adjusted to prevent undesired instances of Warning 528. BSNF, 5/20/11 * We were accidentally describing two structures with different definitions but identical tags as being defined identically. We now recognize the difference. IDTN, 6/1/11 * We were tripping over a printf-style format specifier which involved a string literal and the binary '+' operator. We now handle this situation more gracefully. FSUO, 6/1/11 * We were issuing an undesired instance of Error 148 for an explicit specialization at class scope as in: struct A { template int f(); template<> int f(); }; LTLM, 6/3/11 * We now perform a more accurate analysis for compliance with MISRA C 2004, rule #8.7. MABD, 6/14/11 * We now process GCC's "__attribute__((__sfr__))" to recognize variables which are special function registers and exempt such from MISRA C 2004 rule 8.7 checking. SFRM, 6/14/11 * Lambda/CLI-attribute disambiguation failed for a CLI attribute on a parameter of a function defined outside of its class. Example: struct B { void f( [A( n = 42 )] // ok (CLI attr) int v ); }; void B::f( [A( n = 42 )] // CLI attr; 9.00g sees a lambda. int ){} CALA, 6/20/11 * We were allowing cv-qualified reference types to be created; this is now fixed. Example: struct Q {}; typedef Q &R; template struct S; template<> struct S{}; // ok template<> struct S{}; // Error: redefinition of S RNCV, 6/24/11 * We were issuing undeseved/unhelpful messages 1719, 1720 and 1520 against a move assignment operator. Example: struct A { A& operator=(const A&); A& operator=(A&&); // 9.00g: 1719, 1720, 1520 here }; GSRN-CL-110627-1 BDMO, 6/27/11 * We were issuing unhelpful instances of Warning 641 (implicit conversion of enum to int) on comparisons between values of enumeration type that differ by memory model qualification. Example: //lint +rw(far) enum E { x }; enum E far a; void f( enum E const b ) { if (b == x) // No warning here (good) {} if (a == x) // Unhelpful Warning 641 here {} } GSRN-EN-110627-2 FETI, 6/27/11 * We issued Info 1789 against a constructor template that could not be mistaken for a constructor that could be used as a copy constructor. Example: struct A { template explicit A(const char(&)[N]); // Info not desired }; struct B { template explicit B(const T& ); // Info 1789 desired }; TEDC, 6/27/11 * For a #include directive naming a file that shares the name of a directory that could be found in the "-i" path, we were not checking for whether the directory entry is a regular file before the call to fopen(). GSRN-PP-100720-1 DNRF, 6/27/11 * We issued undeserved Warnings 441 on variables implicitly converted to class type. Example: struct A { A( int ); A(); }; bool f( const A& ); void g() { for( int i=1; f( i ); ++i ) // Undeserved Warning 441 here // 441: for clause irregularity: loop variable 'i' not found // in 2nd for expression {} } GSRN-EP-110628-1 SCEB, 6/28/11 * For a catch clause parameter of type "reference to const X", and where X was a base class of an exception object, we would not recognize the parameter as match, leading to an undeserved info 1775. Example: struct A { }; struct B : public A {}; void f() { try { throw B(); } catch (const A&) {} // Undeserved 1775 here // 1775: catch block does not catch any declared exception } GSRN-EX-110524-3 RCBC, 6/30/11 * Our support for MISRA C++ rule 3-1-1 did not take into account inline functions, entities with internal linkage, or function templates. 311I, 7/5/11 * We issued an undeserved "not-a-member" Error for a definition of a template that is a member of a class that is an explicit specialization. Example: template struct A; template<> struct A { template void g(T); }; template void A::g(T) { } // Undeserved Error 1039 here // 1039: 'g' is not a member of A. // GSRN-TM-100729-2 MTES, 7/5/11 * We issued an undeserved Info 953 against using-declarations declared at block scope. 953U, 7/12/11 * We now flag uses of 00 and '\00' as violations of the MISRA prohibitions against octal constants and octal escape sequences. MDZP, 7/12/11 * Tabs in output -- a new addition to the set of escapes for -format and other similar format directed output is \T. This is replaced by a literal tab in the output. \t remains unchanged as a tab that is replaced by a suitable sequence of blanks. TIFO, 7/18/11 *************** Version 9.00g -- June 1, 2011 *************** * We now more accurately detect violations of MISRA C 2004 rule, #12.6. GSRN-MI-100901-2 * An undeserved Info 866 (unusual use of '>' in argument to sizeof) was issued for the following code int n = sizeof(int) #if (1 > 0) #endif ; GSRN-EP-100923-1 * We now perform a more accurate analysis for enforcing MISRA C++ rule 3-2-3. * During PCH absorption of t.h in the following example, we mistakenly regarded 'const A' as completely-defined immediately after the #include directive; this prevented us from instantiating A when needed (at the start of the body of g(Y), and led to undeserved Errors about the members of that class. // t.h: template struct A { int f (void) const; }; typedef const A Y; // // t1.cpp: //lint -pch(t.h) #include "t.h" void g (Y p) { p.f (); // Undeserved Error 1013 here (PCH absorption) // 1013: Symbol 'f' not a member of class 'const A' } * We were neglecting one of the paragraphs in ISO C++, section [dcl.link] for: extern "C" { void f(void); namespace std { void f(void); } } using std::f; // Undeserved Error 1087 here We now regard the f in namespace std to be an alias to the first (equivalent to what we would do for a using-declaration in that scope). GSRN-US-101002-1 * At the point where we do function temploid instantiations at the end of a translation unit, we were ignoring the fact that A::f below had been explicitly specialized; this lead to an instantiation that should not have happened. template struct A { T m; int f() { return m.h(); } }; template<> int A::f() { return 42; } int g( A& p ) { return p.f(); } // elicits erroneous // instantiation GSRN-TM-081017-1 * In cases involving Microsoft emulation mode and a member class template used as a dependent base class, access checking got confused. Example: //lint ++template(200) allow searches in formerly dependent base // classes template