1//    co-msc40.lnt
2//    Compiler Options for Microsoft C Version 10.x
3//         (32 bit version)
4
5-cmsc
6-si4    // integers are 4 bytes
7-sp4    // pointers are 4 bytes too.
8
9//    This file contains options to allow PC-lint to process source
10//    files for your compiler.  It is used as follows:
11//
12//    lint  co-msc40.lnt  source-file(s)
13//
14-d_M_IX86=300   // assume Intel 80386 architecture -- modify to suit
15
16        // We now support __declspec directly so that the following
17        // option is now commented out.  If trouble ensues you can
18        // once again disable __declspec through this option.
19        // -d__declspec()= // ignore this construct
20-d_declspec=__declspec  // the single '_' version is occasionally used
21            // while processing compiler (library) header files ...
22-wlib(1)    // sets the warning level within library headers to 1
23	    // (no warnings, just syntax errors).  Comment out if you
24	    // are actually linting library headers.  This
25	    // option makes obsolete options of the form -elib(axxx) where
26	    // xxx >= 400 which may be retained for historical reasons.
27-elib(19)   // useless declarations (lone semicolons)
28-elib(123)  // function-like macro name used as non macro
29-elib(652)  // suppress message about #define of earlier declared symbols
30-elib(762)  // suppress message about multiple identical declarations and
31-elib(760)  // suppress message about multiple identical macro defs
32-elib(514)  // allow #if <boolean> | <boolean>
33-elib(553)  // undefined preprocessor variables assumed 0
34-elib(726)  // extraneous comma in enum definition
35
36//  SREGS, WORDREGS, BYTEREGS are defined in both bios.h and dos.h
37//  and accordingly you MAY get type differences based on 'origin'.
38//  If so, use the following options:
39//      -etd(origin)
40//      -elib(770)
41
42-format=%(%f(%l)\s:\s%)%t\s%n:\s%m
43        // error format similar to MSC
44        // Note that %c can also be used to specify column
45-e46    // allows bit-fields to be other than int or unsigned
46+fan    // allow anonymous unions
47+fdi    // Use directory of the including file
48-fbo    // disable the bool type
49-fdh    // do not append a .h to header names
50-ffb    // do not establish a separate scope for declares within for clauses
51-esym(123,min,max)  // allows users to use min, max as variables
52-d_MSC_VER=1000  // for MSC 4.1 make it 1010,
53		 // for MSC 4.2 make it 1020
54+rw(__inline)   // activate the __inline keyword
55+ppw(import)    // activate #import
56-d_inline=__inline  // _inline is the same as __inline
57-sld10          // sizeof(long double) is 10.
58-function(exit,_exit)   // _exit() is like exit()
59-function(exit,_assert)   // _assert() is like exit()
60-emacro(506,assert) // don't warn about constant value Boolean
61-emacro(734,putc)   // don't complain about items being too large.
62-emacro(415,_FP_SEG)  // access of out-of-bounds pointer
63-emacro(740,FP_SEG,FP_OFF)  // unusual casts
64-emacro((???),va_arg)   // the va_arg() macro can yield 415, 416, 661, 662
65			// 796 and 797 (out-of-bounds errors).
66-emacro(413,offsetof)  // use of NULL pointer creates a stir
67-emacro(545,offsetof)  // addressing an array member is OK
68-e793           // inhibit 'ANSI limit reached' --
69		// limits are impractically low with MSVC headers
70-esym(628,eof)  // failure to provide argument information for eof()
71-esym(773,L_tmpnam)     // defined with an unparenthesized '+'
72
73//  The following functions exhibit variable return modes.
74//  That is, they may equally-usefully be called for a value
75//  as called just for their effects.  Accordingly we inhibit
76//  Warning 534 for these functions.
77//  Feel free to add to or subtract from this list.
78
79-esym(534,close,creat,fclose,fflush,_flsbuf,fprintf,fputc)
80-esym(534,fputs,fscanf,fseek,fwrite,lseek,memcpy,memmove,memset)
81-esym(534,printf,puts,scanf,sprintf,sscanf,strcat,strcpy)
82-esym(534,strncat,strncpy,unlink,write)
83
84//  These are the wide char variants of printf-scanf family
85
86-wprintf( 1, wprintf )
87-wprintf( 2, fwprintf, swprintf )
88-wscanf( 1, wscanf )
89-wscanf( 2, fwscanf, swscanf )
90
91
92// The following options are required by most compilers to
93// noiselessly process iostream.h
94
95-elib(1717) //empty prototypes
96-elib(522) //function return value ignored
97-elib(1053) //prototypes cannot be distinguished
98-elib(1721) //unusual operator =() declaration
99-elib(1720) //assignment op has non-const parameter
100-elib(655)  // bitwise operator combining compatible enum's
101-elib(641)  // converting enum's to int
102-elib(537)  // repeated include file (ios.h)
103-elib(1511) // member (rdbuf) hides nonvirtual member
104-elib(1712) // default constructor not defined for class
105-elib(1736) // redundant access specifier
106-esym(1702,operator<<,operator>>)  // both a member and an ordinary function
107
108// These functions return things that are frequently ignored.
109
110-esym(534,*operator<<,*operator>>)
111
112// The following additional options seem to be needed.
113
114-elib(506) // constant value Boolean
115-elib(620) // el or one? (some constants end in 'l' not 'L')
116-elib(648) // overflow in computing constant (3<<16)
117-elib(659) // nothing follows '}' on some line
118-elib(723) // suspicious use of '='
119-elib(747) //significant prototype coercion
120-elib(740) //unusual pointer casts
121-elib(1007) // virtual functions within extern "C" block
122-elib(1029) //default argument repeated -- can't dist. char, signed char
123-elib(1055) //call to rdbuf() questioned?
124-elib(1504) // apparently useless structs
125-elib(1708,1709) // minor C/C++ declaration conflict
126-elib(1707) // operator new declared w/o 'static'
127-elib(1722) // assignment op does not return reference
128-elib(149)  // default argument found in C code.
129-elib(578)  // declaration of time hides delaration of global time().
130-elib(761)  // two equivalent typedef declarations
131-elib(1065)  // same name declared as "C" and not "C"
132-elib(1066)  // same name declared as "C" and not "C"
133-elib(1704)   // constructor with private access declaration
134-elib(773)  // macros that look like unparenthesized expressions
135-elib(806)  // 1-bit bitfields typed int
136-elib(1501) // 0-length data members
137-elib(1510) // base class has no destructor
138-elib(1516) // data member hides inherited member
139-elib(1509) // base class destructor is not virtual
140-elib(1735) // default parameter within virtual function
141
142// Special Notice:  You may be receiving mysterious 1058 errors
143//   when you use "iomanipulator"s.  For example:
144//   cout << setw(4) << 4;
145//   results in Error 1058 (assigning a const to a ref) because the
146//   manipulator setw returns a non-lvalue which is assigned to a reference.
147//   This reflects an oversight in the Microsoft header file: iomanip.h
148//   Therein you may change the declaration:
149//     friend ostream& operator<<(iostream& s, IOMANIP(T) & sm) { ...
150//   to:
151//     friend ostream& operator<<(iostream& s, const IOMANIP(T) & sm) { ...
152//   to reflect the fact that sm is not modified by this function.
153
154
155
156//    The following options are needed for MS Visual C++ 2.00 and 4.x
157
158-d_M_IX86=300   // define the architecture (one of _M_IX86, _M_ALPHA,
159		// _M_PPC, _M_MRX000)
160-d_INTEGRAL_MAX_BITS=64  // denotes support for __int64
161+fll            // enable long long
162-d__STDC__=0    // Starting with 2.0, the tests within Microsoft header
163		// files for __STDC__ are of the form #if rather than #ifdef
164-dWIN32         // this is necessary because without WIN32 being defined
165-d_WIN32        // a very gross syntax error is exposed in the objbase.h
166		// definition of function operator ==().  Alternatively,
167		// repair the function definition.
168-dDBG=0         // There is a #if test made for this variable.
169
170/*  DLL's  or Multithreads?  Enable the following:
171
172    -d_AFXDLL   // making a DLL
173    -d_DLL      // ditto
174    -d_MT       // multi-thread
175
176 */
177
178-esym(123,FD_SET)  // defined as macro and as typedef
179-esym(1726,endl,ends)   // taking the address of an overloaded function
180-elib(43)       // vacuous array within _MIDL_FORMAT_STRING
181-elib(602)      // benign comment within comment
182-elib(657)      // declaring "anonymous struct" in union _LARGE_INTEGER
183-elib(799)      // long numerical constant for max. __int64
184-elib(1502)     // nothrow has no data members
185-elib(1505)     // no access specifier in base class specifier
186-elib(1515)     // AFX_THREAD_STATE member has no default constructor
187-elib(1706)     // Unusual declaration with a scope operator
188-elib(1725)     // data member is a reference
189
190-elib(1548)     // conflicting exception specifications
191-elib(1737)     // hiding global operator new
192-elib(1739)     // binary operator should be non-member function
193-elib(1748)     // non-virtual base class included twice
194-elib(1759)     // post-fix operator returns a reference
195