137 lines
5.6 KiB
Plaintext
137 lines
5.6 KiB
Plaintext
// Compiler Options for Linux and GCC
|
|
|
|
// This file contains options to allow FlexeLint to process source
|
|
// files for the Gnu compiler (GCC) running on Linux.
|
|
// It is used as follows:
|
|
//
|
|
// lint co-gnu.lnt source-file(s)
|
|
//
|
|
// If you are using GCC on some other system you will need to change
|
|
// the following options:
|
|
|
|
+cpp(.cc,.C) // extensions for C++ that are commonly used in addition
|
|
// to the default extensions of .cpp and .cxx
|
|
|
|
-cgnu // defines LANGUAGE_C for C modules
|
|
-d__i386__ // a define of this type is machine-dependent
|
|
// modify if you are running on non-intel hardware.
|
|
-d__linux__ // Linux define!
|
|
//-d__mc68000__ //a machine dependent define
|
|
|
|
-di386=1 // needed for some Unix's
|
|
-a#machine(i386) // #assert's machine(i386) (SVR4 facility).
|
|
|
|
-i/usr/include // Set an include directory
|
|
-i/usr/lib/gcc-lib/i486-linux/2.5.8/include // Linux gcc uses TWO directories
|
|
|
|
-si4 // int's are typically 4 bytes
|
|
-sp4 // ptr's are typically 4 bytes
|
|
|
|
// end of system dependent options.
|
|
|
|
-fdc // do not Distinguish plain Char as a unique type.
|
|
// i.e. char is either signed char or unsigned char
|
|
|
|
// while processing library headers
|
|
-wlib(1) // sets the warning level within library headers to 1
|
|
// (no warnings, just syntax errors). Comment out if you
|
|
// are actually linting library headers. This
|
|
// option makes obsolete options of the form -elib(axxx) where
|
|
// xxx >= 400 which may be retained for historical reasons.
|
|
-elib(15) // redeclaration of symbol
|
|
-elib(516) // lots of redeclarations in Linux stdlib.h
|
|
-elib(652) // suppress message about #define of earlier declared symbols
|
|
-elib(762) // suppress message about multiple identical declarations and
|
|
-elib(760) // suppress message about multiple identical macro defs
|
|
-elib(553) // undefined preprocessor variables are taken as 0
|
|
-elib(410) // unusual size_t
|
|
-elib(767) // differently defined macro
|
|
-elib(624) // typedef symbol redeclared
|
|
-elib(607) // parameter substitution within string
|
|
-elib(602) // in dial.h there are comments within comments ?
|
|
-elib(537) // repeated include files
|
|
-elib(2) // unclosed quotes in nserve.h
|
|
-elib(123) // size is both a variable and a macro with args
|
|
-elib(1014) // class member definition within extern "C++"
|
|
|
|
-emacro(734,putc) // don't complain about items being too large.
|
|
-emacro((???),va_arg) // the va_arg() macro can yield 415, 416, 661, 662
|
|
// 796 and 797 (out-of-bounds errors).
|
|
-emacro(413,offsetof) // use of NULL pointer creates a stir
|
|
-emacro(545,offsetof) // addressing an array member is OK
|
|
|
|
-elib(793) // Linux has minor ANSI violation in stddef.h
|
|
-elib(569) // Linux truncates some data in huge_val.h
|
|
-esym(528,__huge_val,__nan,__qnan,__qnanf,__snan,__snanf)
|
|
// We don't care if we don't reference some GNU funcs
|
|
-esym(528,__gnu_malloc,__gnu_calloc)
|
|
|
|
|
|
// The following options were found necessary when processing
|
|
// the Unix headers within /usr/include
|
|
|
|
+fdi // Use the directory of the including file
|
|
|
|
+ppw(ident) // Tolerate #ident
|
|
+rw(__inline) // enable the (non-standard) __inline keyword
|
|
+rw(__inline__) // enable the (non-standard) __inline__ keyword
|
|
|
|
// The following functions exhibit variable return modes.
|
|
// That is, they may equally-usefully be called for a value
|
|
// as called just for their effects. Accordingly we inhibit
|
|
// Warning 534 for these functions.
|
|
// Feel free to add to or subtract from this list.
|
|
|
|
-esym(534,close,creat,fclose,fprintf,fputc)
|
|
-esym(534,fputs,fscanf,fseek,fwrite,lseek,memcpy,memmove,memset)
|
|
-esym(534,printf,puts,scanf,sprintf,sscanf,strcat,strcpy)
|
|
-esym(534,strncat,strncpy,unlink,write)
|
|
|
|
// For non-ANSI compilers we suppress messages 515 and 516
|
|
// for functions known to have variable argument lists.
|
|
// For ANSI compilers, header files should take care of this.
|
|
|
|
-esym(515,fprintf,printf,sprintf,fscanf,scanf,sscanf)
|
|
-esym(516,fprintf,printf,sprintf,fscanf,scanf,sscanf)
|
|
|
|
// The following options are required by most compilers to
|
|
// noiselessly process iostream.h
|
|
|
|
-elib(1717) //empty prototypes
|
|
-elib(522) //function return value ignored
|
|
-elib(1053) //prototypes cannot be distinguished
|
|
-elib(1721) //unusual operator =() declaration
|
|
-elib(1720) //assignment op has non-const parameter
|
|
-elib(655) // bitwise operator combining compatible enum's
|
|
-elib(641) // converting enum's to int
|
|
-elib(537) // repeated include file (ios.h)
|
|
-elib(1511) // member (rdbuf) hides nonvirtual member
|
|
-elib(1712) // default constructor not defined for class
|
|
-esym(1702,operator<<,operator>>)
|
|
|
|
// These functions return things that are frequently ignored.
|
|
|
|
-esym(534,ostream::operator<<,istream::operator>>)
|
|
|
|
-elib(747) //significant prototype coercion
|
|
-elib(740) //unusual pointer casts
|
|
-elib(1029) //default argument repeated -- can't dist. char, signed char
|
|
-elib(1055) //call to rdbuf() questioned?
|
|
-elib(1708,1709) // minor C/C++ declaration conflict
|
|
|
|
-elib(763) // redundant declaration
|
|
-elib(1510) // base class has no destructor
|
|
-elib(1516) // data member hiding inherited member
|
|
-elib(1730) // class/struct inconsistancy
|
|
-elib(569) // loss of information 8-bits - 7bits
|
|
|
|
-e93 // allow newlines within quoted string arguments to macros
|
|
-dasm()= // support inline assembly code by ignoring asm(...)
|
|
-d__attribute__()= // ignore this keyword and following parenthetical
|
|
-d__extension__= // ignore this keyword
|
|
-d__builtin_va_list=void* // used by stdarg.h
|
|
-d__const=const // gconv.h uses __const rather than const
|
|
-d__STDC_VERSION__=199901L // required by C99
|
|
-d__FUNCTION__="somefunction"
|
|
-d__PRETTY_FUNCTION__="somefunction"
|