// Compiler Options for cygwin and GCC // This file contains options to allow pc-lint to process source // files for the Gnu compiler (GCC) running on cygwin. // It is used as follows: // // lint co-cygwin.lnt source-file(s) // derived from co-gnu3.lnt // // If you are using GCC on some other system you will need to change // the following options: +cpp(.cc) // extensions for C++ that are commonly used in addition // to the default extensions of .cpp and .cxx // -cgnu imports all symbols of the std namespace into the global // namespace. May need to be disabled if necessary. -cgnu // defines LANGUAGE_C for C modules // Begin: System Dependent Options // ------------------------------- -d__i386__ // a define of this type is machine-dependent // modify if you are running on non-intel hardware. -d__CYGWIN32__ // Cygwin define! -d__CYGWIN__ // Cygwin define! //-d__unix__ //-d__mc68000__ //a machine dependent define -A // put in ANSI mode to get prototypes //-d__STDC__ // to get prototypes -di386=1 // needed for some Unix's -a#machine(i386) // #assert's machine(i386) (SVR4 facility). // gcc 3.x on cygwin -iD:\cygwin\usr\include\c++\3.3.1 -iD:\cygwin\usr\include\c++\3.3.1\i686-pc-cygwin -iD:\cygwin\usr\include\c++\3.3.1\backward -iD:\cygwin\lib\gcc-lib\i686-pc-cygwin\3.3.1\include -iD:\cygwin\usr\include -iD:\cygwin\usr\include\w32api //-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: System Dependent Options // 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 // What follows here is a collection of options we have found // to be needed to support Version 3 of GCC. The need for these // options actually predate Version 3 and are of the 2.9... time frame -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__builtin_stdarg_start()=_to_semi // ditto -d__builtin_va_end()=_to_semi // ditto +rw(_to_semi) // needed for the two macros above. -d__const=const // gconv.h uses __const rather than const -d__STDC_VERSION__=199901L // required by C99 -d__FUNCTION__="somefunction" -d__PRETTY_FUNCTION__="somefunction" +fwc // wchar_t is builtin -d_WCHAR_T // tell the header files as much -elib(148) // Some of the libraries are redefining member // functions -elib(1073) // reverse_iterator<> is being invoked with // an insufficient number of parameters. +rw(__typeof__) // activate __typeof__ keyword -d__typeof=__typeof__ // an alternative to using __typeof__ +rw( __volatile__ ) // unusual reserved word ignored. +rw( _to_brackets ) // a pair of options to ignore an elaborated +d__asm__=_to_brackets // assembly language escape. -rw(__except) // This MS reserved word is used as an identifier +rw( __complex__, __real__, __imag__ ) // reserved words that can be ignored. +d__builtin_strchr=(char*) // permits the inline definition ... +d__builtin_strpbrk=(char*) // of these functions to be linted ... +d__builtin_strrchr=(char*) // without drawing a complaint +d__builtin_strstr=(char*) // about the use of a non-standard name -esym( 718, __builtin_* ) // The compiler does not need these ... -esym( 746, __builtin_* ) // declared and it knows their prototypes. -d__EXCEPTIONS // make sure try and catch are not redefined out // from under you as execeptions_defines.h could do --uconst // keep const from being defined away // Cygwin specific -emacro(64,NULL) // shut up mismatch pt to void/nonvoid -function( exit , __assert ) // __assert does not return -rw(far) // This MS reserved word is used as an identifier -rw(huge) // This MS reserved word is used as an identifier -rw(interrupt) // This MS reserved word is used as an identifier -rw(near) // This MS reserved word is used as an identifier // deal with -esym(628,std::__builtin_huge_valf) -esym(628,std::__builtin_nanf) -esym(628,std::__builtin_huge_val) -esym(628,std::__builtin_nan) -esym(628,std::__builtin_huge_vall) -esym(628,std::__builtin_nanl) -elib(1039) // locale_facets trouble // Using gcc -E -dM -xc /dev/null -d__DBL_MIN_EXP__=(-1021) -d__FLT_MIN__=1.17549435e-38F //-d_X86_=1 -d__CHAR_BIT__=8 -d__WCHAR_MAX__=65535U -d__DBL_DENORM_MIN__=4.9406564584124654e-324 -d__FLT_EVAL_METHOD__=2 //-d__unix__=1 //-dunix=1 //-d__i386__=1 //-d__SIZE_TYPE__="unsigned int" -d__DBL_MIN_10_EXP__=(-307) //-d__FINITE_MATH_ONLY__=0 //-d__GNUC_PATCHLEVEL__=1 -d__FLT_RADIX__=2 -d__LDBL_EPSILON__=1.08420217248550443401e-19L //-d_stdcall=__attribute__((__stdcall__)) -d__SHRT_MAX__=std:32767 -d__LDBL_MAX__=1.18973149535723176502e+4932L //-d__CYGWIN__=1 //-d__unix=1 -d__LDBL_MAX_EXP__=16384 -d__LONG_MAX__=2147483647L -d__SCHAR_MAX__=127 -d__DBL_DIG__=15 //-d__USER_LABEL_PREFIX__=_ //-d__STDC_HOSTED__=1 //-d__stdcall=__attribute__((__stdcall__)) -d__LDBL_MANT_DIG__=64 -d__FLT_EPSILON__=1.19209290e-7F //-d__tune_i686__=1 -d__LDBL_MIN__=3.36210314311209350626e-4932L //-d__WCHAR_TYPE__="short unsigned int" -d__FLT_DIG__=6 -d__FLT_MAX_10_EXP__=38 -d__INT_MAX__=2147483647 -d__FLT_MAX_EXP__=128 -d__DECIMAL_DIG__=21 -d__DBL_MANT_DIG__=53 //-d__WINT_TYPE__="unsigned int" //-d__GNUC__=3 //-d_cdecl=__attribute__((__cdecl__)) -d__LDBL_MIN_EXP__=(-16381) -d__LDBL_MAX_10_EXP__=4932 -d__DBL_EPSILON__=2.2204460492503131e-16 -d__DBL_MAX__=1.7976931348623157e+308 //-d__tune_pentiumpro__=1 //-d__fastcall=__attribute__((__fastcall__)) //-d_fastcall=__attribute__((__fastcall__)) //-d__CYGWIN32__=1 //-d__USING_SJLJ_EXCEPTIONS__=1 -d__DBL_MAX_EXP__=1024 -d__FLT_DENORM_MIN__=1.40129846e-45F -d__LONG_LONG_MAX__=9223372036854775807LL -d__FLT_MAX__=3.40282347e+38F //-d__GXX_ABI_VERSION=102 -d__FLT_MIN_10_EXP__=(-37) -d__FLT_MIN_EXP__=(-125) //-di386=1 //-d__GNUC_MINOR__=3 -d__DBL_MAX_10_EXP__=308 -d__LDBL_DENORM_MIN__=3.64519953188247460253e-4951L -d__DBL_MIN__=2.2250738585072014e-308 //-d__PTRDIFF_TYPE__=int -d__LDBL_MIN_10_EXP__=(-4931) //-d__REGISTER_PREFIX__ //-d__cdecl=__attribute__((__cdecl__)) -d__LDBL_DIG__=18 //-d__NO_INLINE__=1 //-d__i386=1 -d__FLT_MANT_DIG__=24