3 // Compiler Options for GCC versions 2.95.3 and later
5 // This file contains options to allow FlexeLint to process source
6 // files for the Gnu compiler (GCC).
8 // flint co-gnu3.lnt source-file(s)
10 // If you are using GCC on some other system you will need to change
11 // the following options:
13 -cgnu // Notifies FlexeLint that gcc is being used.
15 // Begin: System Dependent Options
16 // -------------------------------
18 -di386=1 // needed for some Unix's
19 -a#machine(i386) // #assert's machine(i386) (SVR4 facility).
21 // What follows is the trickiest thing about a gcc installation, i.e.,
22 // one or more -i options to tell FlexeLint where the header files
25 // -i/FlexeLint/supp/ansi // This we humbly offer as a collection of ...
26 // ANSI (i.e ISO) header files. Replace the word "FlexeLint"
27 // with the name of the directory in which FlexeLint has
28 // been installed. Note, you might want to replace "ansi"
31 // -----------------------------
32 // End: System Dependent Options
34 +cpp(.cc,.C) // extensions for C++ that are commonly used in addition
35 // to the default extensions of .cpp and .cxx
37 // while processing library headers
38 -wlib(1) // sets the warning level within library headers to 1
39 // (no warnings, just syntax errors). Comment out if you
40 // are actually linting library headers. This
41 // option makes obsolete options of the form -elib(axxx) where
42 // xxx >= 400 which may be retained for historical reasons.
43 -elib(15) // redeclaration of symbol
44 -elib(516) // lots of redeclarations in Linux stdlib.h
45 -elib(652) // suppress message about #define of earlier declared symbols
46 -elib(762) // suppress message about multiple identical declarations and
47 -elib(760) // suppress message about multiple identical macro defs
48 -elib(553) // undefined preprocessor variables are taken as 0
49 -elib(410) // unusual size_t
50 -elib(767) // differently defined macro
51 -elib(624) // typedef symbol redeclared
52 -elib(607) // parameter substitution within string
53 -elib(602) // in dial.h there are comments within comments ?
54 -elib(537) // repeated include files
55 -elib(2) // unclosed quotes in nserve.h
56 -elib(123) // size is both a variable and a macro with args
57 -elib(1014) // class member definition within extern "C++"
59 -emacro(734,putc) // don't complain about items being too large.
60 -emacro((???),va_arg) // the va_arg() macro can yield 415, 416, 661, 662
61 // 796 and 797 (out-of-bounds errors).
62 -emacro(413,offsetof) // use of NULL pointer creates a stir
63 -emacro(545,offsetof) // addressing an array member is OK
65 -elib(793) // Linux has minor ANSI violation in stddef.h
66 -elib(569) // Linux truncates some data in huge_val.h
67 -esym(528,__huge_val,__nan,__qnan,__qnanf,__snan,__snanf)
68 // We don't care if we don't reference some GNU funcs
69 -esym(528,__gnu_malloc,__gnu_calloc)
72 // The following options were found necessary when processing
73 // the Unix headers within /usr/include
75 +fdi // Use the directory of the including file
77 +ppw(ident) // Tolerate #ident
78 +rw(__inline) // enable the (non-standard) __inline keyword
79 +rw(__inline__) // enable the (non-standard) __inline__ keyword
81 // The following functions exhibit variable return modes.
82 // That is, they may equally-usefully be called for a value
83 // as called just for their effects. Accordingly we inhibit
84 // Warning 534 for these functions.
85 // Feel free to add to or subtract from this list.
87 -esym(534,close,creat,fclose,fprintf,fputc)
88 -esym(534,fputs,fscanf,fseek,fwrite,lseek,memcpy,memmove,memset)
89 -esym(534,printf,puts,scanf,sprintf,sscanf,strcat,strcpy)
90 -esym(534,strncat,strncpy,unlink,write)
92 // For non-ANSI compilers we suppress messages 515 and 516
93 // for functions known to have variable argument lists.
94 // For ANSI compilers, header files should take care of this.
96 -esym(515,fprintf,printf,sprintf,fscanf,scanf,sscanf)
97 -esym(516,fprintf,printf,sprintf,fscanf,scanf,sscanf)
99 // The following options are required by most compilers to
100 // noiselessly process iostream.h
102 -elib(1717) //empty prototypes
103 -elib(522) //function return value ignored
104 -elib(1053) //prototypes cannot be distinguished
105 -elib(1721) //unusual operator =() declaration
106 -elib(1720) //assignment op has non-const parameter
107 -elib(655) // bitwise operator combining compatible enum's
108 -elib(641) // converting enum's to int
109 -elib(537) // repeated include file (ios.h)
110 -elib(1511) // member (rdbuf) hides nonvirtual member
111 -elib(1712) // default constructor not defined for class
112 -esym(1702,operator<<,operator>>)
114 // These functions return things that are frequently ignored.
116 -esym(534,ostream::operator<<,istream::operator>>)
118 -elib(747) //significant prototype coercion
119 -elib(740) //unusual pointer casts
120 -elib(1029) //default argument repeated -- can't dist. char, signed char
121 -elib(1055) //call to rdbuf() questioned?
122 -elib(1708,1709) // minor C/C++ declaration conflict
124 -elib(763) // redundant declaration
125 -elib(1510) // base class has no destructor
126 -elib(1516) // data member hiding inherited member
127 -elib(1730) // class/struct inconsistancy
128 -elib(569) // loss of information 8-bits - 7bits
130 // What follows here is a collection of options we have found
131 // to be needed to support Version 3 of GCC. The need for these
132 // options actually predate Version 3 and are of the 2.9... time frame
134 -e93 // allow newlines within quoted string arguments to macros
135 -dasm()= // support inline assembly code by ignoring asm(...)
136 -d__attribute__()= // ignore this keyword and following parenthetical
137 -d__extension__= // ignore this keyword
138 -d__builtin_va_list=void* // used by stdarg.h
139 -d__builtin_stdarg_start()=_to_semi // ditto
140 -d__builtin_va_end()=_to_semi // ditto
141 +rw(_to_semi) // needed for the two macros above.
142 -d__const=const // gconv.h uses __const rather than const
143 -d__STDC_VERSION__=199901L // required by C99
144 -d__FUNCTION__="somefunction"
145 -d__PRETTY_FUNCTION__="somefunction"
146 +fwc // wchar_t is builtin
147 -d_WCHAR_T // tell the header files as much
148 -elib(148) // Some of the libraries are redefining member
150 -elib(1073) // reverse_iterator<> is being invoked with
151 // an insufficient number of parameters.
152 +rw(__typeof__) // activate __typeof__ keyword
153 -d__typeof=__typeof__ // an alternative to using __typeof__