xref: /utopia/UTPA2-700.0.x/projects/tools/lint/lnt/co-gnu3.lnt (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1
2//    co-gnu3.lnt
3//    Compiler Options for GCC versions 2.95.3 and later
4
5//    This file contains options to allow FlexeLint to process source
6//    files for the Gnu compiler (GCC).
7//
8//    flint  co-gnu3.lnt  source-file(s)
9//
10//    If you are using GCC on some other system you will need to change
11//    the following options:
12
13-cgnu       // Notifies FlexeLint that gcc is being used.
14// +fus     // activate this option if your compiler supports an assumed
15            // using namespace std at the beginning of processing
16
17// Begin: System Dependent Options
18// -------------------------------
19
20-d__i386__  // a define of this type is machine-dependent
21            // modify if you are running on non-intel hardware.
22-d__linux__ // Linux define!
23//-d__mc68000__  //a machine dependent define
24
25-di386=1         // needed for some Unix's
26-a#machine(i386) //  #assert's machine(i386)  (SVR4 facility).
27
28// To let FlexeLint know where to find header files you need one
29// or more -i options where each -i option is followed immediately
30// by a single directory.
31// For example:     -i/usr/include
32// Use 'cpp -v emptyfile.cpp' to get a list of C++ search directories.
33// Use 'cpp -v emptyfile.c' to get a list of C search directories.
34
35// You may use the following option to include standard C headers.
36// This would normally come before other -i options.
37
38-i/FlexeLint/supp/ansi  // This is offered as a collection of ...
39            // ANSI (i.e ISO) header files.  Replace the word "FlexeLint"
40            // with the name of the directory in which FlexeLint has
41            // been installed.  Note, you might want to replace "ansi"
42            // with "posix".
43
44-si4    // int's are typically 4 bytes
45-sp4    // ptr's are typically 4 bytes
46
47// -----------------------------
48// End: System Dependent Options
49
50+cpp(.cc,.C)  // extensions for C++ that are commonly used in addition
51            // to the default extensions of .cpp and .cxx
52+fld        // support gcc's label designators
53
54            // while processing library headers
55-wlib(1)    // sets the warning level within library headers to 1
56	    // (no warnings, just syntax errors).  Comment out if you
57	    // are actually linting library headers.  This
58	    // option makes obsolete options of the form -elib(axxx) where
59	    // xxx >= 400 which may be retained for historical reasons.
60-elib(15)   // redeclaration of symbol
61-elib(516)  // lots of redeclarations in Linux stdlib.h
62-elib(652)  // suppress message about #define of earlier declared symbols
63-elib(762)  // suppress message about multiple identical declarations and
64-elib(760)  // suppress message about multiple identical macro defs
65-elib(553)  // undefined preprocessor variables are taken as 0
66-elib(410)  // unusual size_t
67-elib(767)  // differently defined macro
68-elib(624)  // typedef symbol redeclared
69-elib(607)  // parameter substitution within string
70-elib(602)  // in dial.h there are comments within comments ?
71-elib(537)  // repeated include files
72-elib(2)    // unclosed quotes in nserve.h
73-elib(123)  // size is both a variable and a macro with args
74-elib(1014) // class member definition within extern "C++"
75
76-emacro(734,putc)   // don't complain about items being too large.
77-emacro((???),va_arg)   // the va_arg() macro can yield 415, 416, 661, 662
78			// 796 and 797 (out-of-bounds errors).
79-emacro(413,offsetof)  // use of NULL pointer creates a stir
80-emacro(545,offsetof)  // addressing an array member is OK
81
82-elib(793)   // Linux has minor ANSI violation in stddef.h
83-elib(569)   // Linux truncates some data in huge_val.h
84-esym(528,__huge_val,__nan,__qnan,__qnanf,__snan,__snanf)
85           // We don't care if we don't reference some GNU funcs
86-esym(528,__gnu_malloc,__gnu_calloc)
87
88
89//  The following options were found necessary when processing
90//  the Unix headers within /usr/include
91
92+fdi            // Use the directory of the including file
93
94+ppw(ident)     // Tolerate #ident
95+rw(__inline)   // enable the (non-standard) __inline keyword
96+rw(__inline__)   // enable the (non-standard) __inline__ keyword
97
98//  The following functions exhibit variable return modes.
99//  That is, they may equally-usefully be called for a value
100//  as called just for their effects.  Accordingly we inhibit
101//  Warning 534 for these functions.
102//  Feel free to add to or subtract from this list.
103
104-esym(534,close,creat,fclose,fprintf,fputc)
105-esym(534,fputs,fscanf,fseek,fwrite,lseek,memcpy,memmove,memset)
106-esym(534,printf,puts,scanf,sprintf,sscanf,strcat,strcpy)
107-esym(534,strncat,strncpy,unlink,write)
108
109// For non-ANSI compilers we suppress messages 515 and 516
110// for functions known to have variable argument lists.
111// For ANSI compilers, header files should take care of this.
112
113-esym(515,fprintf,printf,sprintf,fscanf,scanf,sscanf)
114-esym(516,fprintf,printf,sprintf,fscanf,scanf,sscanf)
115
116// The following options are required by most compilers to
117// noiselessly process iostream.h
118
119-elib(1717) //empty prototypes
120-elib(522) //function return value ignored
121-elib(1053) //prototypes cannot be distinguished
122-elib(1721) //unusual operator =() declaration
123-elib(1720) //assignment op has non-const parameter
124-elib(655)  // bitwise operator combining compatible enum's
125-elib(641)  // converting enum's to int
126-elib(537)  // repeated include file (ios.h)
127-elib(1511) // member (rdbuf) hides nonvirtual member
128-elib(1712) // default constructor not defined for class
129-esym(1702,operator<<,operator>>)
130
131// These functions return things that are frequently ignored.
132
133-esym(534,ostream::operator<<,istream::operator>>)
134
135-elib(747) //significant prototype coercion
136-elib(740) //unusual pointer casts
137-elib(1029) //default argument repeated -- can't dist. char, signed char
138-elib(1055) //call to rdbuf() questioned?
139-elib(1708,1709) // minor C/C++ declaration conflict
140
141-elib(763)   // redundant declaration
142-elib(1510)  // base class has no destructor
143-elib(1516)  // data member hiding inherited member
144-elib(1730)  // class/struct inconsistancy
145-elib(569)   // loss of information 8-bits - 7bits
146
147// What follows here is a collection of options we have found
148// to be needed to support Version 3 of GCC.  The need for these
149// options actually predate Version 3 and are of the 2.9... time frame
150
151-e93         // allow newlines within quoted string arguments to macros
152-dasm()=     // support inline assembly code by ignoring asm(...)
153-d__attribute__()=   // ignore this keyword and following parenthetical
154-d__extension__=            // ignore this keyword
155-d__builtin_va_list=void*   // used by stdarg.h
156-d__builtin_stdarg_start()=_to_semi  // ditto
157-d__builtin_va_end()=_to_semi        // ditto
158-d__builtin_fabsf=(float)
159-d"__builtin_fabsl=(long double)"
160-d__builtin_cosf=(float)
161-d"__builtin_cosl=(long double)"
162-d__builtin_sinf=(float)
163-d"__builtin_sinl=(long double)"
164-d__builtin_sqrtf=(float)
165-d"__builtin_sqrtl=(long double)"
166-d"__builtin_fabs=(double)"
167+rw(_to_semi)               // needed for the two macros above.
168-d__const=const             // gconv.h uses __const rather than const
169-d__STDC_VERSION__=199901L  // required by C99
170-d__FUNCTION__="somefunction"
171-d__PRETTY_FUNCTION__="somefunction"
172+fwc                    // wchar_t is builtin
173-d_WCHAR_T              // tell the header files as much
174-elib(148)              // Some of the libraries are redefining member
175                        // functions
176-elib(1073)             // reverse_iterator<> is being invoked with
177                        // an insufficient number of parameters.
178+rw(__typeof__)         // activate __typeof__ keyword
179-d__typeof=__typeof__   // an alternative to using __typeof__
180+rw( __volatile__ )         // unusual reserved word ignored.
181+rw( _to_brackets )         // a pair of options to ignore an elaborated
182+d__asm__=_to_brackets      // assembly language escape.
183-rw(__except)               // This MS reserved word is used as an identifier
184+rw( __complex__, __real__, __imag__ )  // reserved words that can be ignored.
185+d__builtin_strchr=(char*)  // permits the inline definition ...
186+d__builtin_strpbrk=(char*) // of these functions to be linted ...
187+d__builtin_strrchr=(char*) // without drawing a complaint
188+d__builtin_strstr=(char*)  // about the use of a non-standard name
189-esym( 718, __builtin_* )   // The compiler does not need these ...
190-esym( 746, __builtin_* )   // declared and it knows their prototypes.
191-d__EXCEPTIONS              // make sure try and catch are not redefined out
192                            // from under you as execeptions_defines.h could do
193--uconst                    // keep const from being defined away
194
195+rw(__restrict)             // ignore this keyword.
196
197// The following was produced by `gcc -v`, and may not be necessary.
198// Naturally if you include these options, you should make sure they
199// match your version of GCC:
200//  -d__GNUC__=3
201//  -d__GNUC_MINOR__=3
202//  -d__GNUC_PATCHLEVEL__=2
203-d_GNU_SOURCE
204
205// Built-in identifiers follow.  These constants are compiled into gcc and are not
206// defined in any GCC headers.  They might vary from platform to platform.  To
207// see what they are on yours, put the following into a source file and run it
208// through gcc with the -E option; copy the result into your local copy of
209// co-gnu3.lnt if your output differs from the constants used for the -d Lint options below:
210	// //---begin builtin.c---
211	//  __CHAR_BIT__
212	//  __FLT_MANT_DIG__
213	//  __FLT_DIG__
214	//  __FLT_RADIX__
215	//  __FLT_MIN_EXP__
216	//  __FLT_MIN_10_EXP__
217	//  __FLT_MAX_EXP__
218	//  __FLT_MAX_10_EXP__
219	//  __FLT_DENORM_MIN__
220	//  __DBL_MANT_DIG__
221	//  __DBL_DIG__
222	//  __FLT_RADIX__
223	//  __DBL_MIN_EXP__
224	//  __DBL_MIN_10_EXP__
225	//  __DBL_MAX_EXP__
226	//  __DBL_MAX_10_EXP__
227	//  __DBL_DENORM_MIN__
228	//  __LDBL_MANT_DIG__
229	//  __LDBL_DIG__
230	//  __LDBL_MIN_EXP__
231	//  __LDBL_MIN_10_EXP__
232	//  __LDBL_MAX_EXP__
233	//  __LDBL_MAX_10_EXP__
234	//  __LDBL_DENORM_MIN__
235	// //--end builtin.c---
236-d__CHAR_BIT__=8
237-d__FLT_MANT_DIG__=24
238-d__FLT_DIG__=6
239-d__FLT_RADIX__=2
240-d__FLT_MIN_EXP__=(-125)
241-d__FLT_MIN_10_EXP__=(-37)
242-d__FLT_MAX_EXP__=128
243-d__FLT_MAX_10_EXP__=38
244-d__FLT_DENORM_MIN__=1.40129846e-45F
245-d__DBL_MANT_DIG__=53
246-d__DBL_DIG__=15
247-d__FLT_RADIX__=2
248-d__DBL_MIN_EXP__=(-1021)
249-d__DBL_MIN_10_EXP__=(-307)
250-d__DBL_MAX_EXP__=1024
251-d__DBL_MAX_10_EXP__=308
252-d__DBL_DENORM_MIN__=4.9406564584124654e-324
253-d__LDBL_MANT_DIG__=64
254-d__LDBL_DIG__=18
255-d__LDBL_MIN_EXP__=(-16381)
256-d__LDBL_MIN_10_EXP__=(-4931)
257-d__LDBL_MAX_EXP__=16384
258-d__LDBL_MAX_10_EXP__=4932
259-d__LDBL_DENORM_MIN__=3.64519953188247460253e-4951L
260
261//bypass too large line error
262-e91
263-e10
264-ident($)
265-e156