/*
 * Toplevel control file for FlexeLint
 */

//d__flexelint_v9__=1
+fan

-emacro((835),*)	// A zero has been given as ___ argument to operator '___

///////////////////////////////////////////////////////////////////////
// build/config related

-efile(451, "tbl/*.h")		// No include guard
-efile(537, "tbl/*.h")		// Repeated include

-efile(451, "../../include/vut_options.h")		// No include guard
-efile(451, "../../include/vapi/vapi_options.h")	// No include guard

-efile(451, ../../config.h)	// No include guard
-efile(766, ../../config.h)	// Header file '___' not used in module '___'

+libh(../../config.h)

-esym(768, vmod_priv)	// global struct member '___' (___) not referenced

///////////////////////////////////////////////////////////////////////
// Thread/locking, too many false positives still
-e454		// A thread mutex has been locked but not unlocked___
-e455		// A thread mutex that had not been locked is being unlocked
-e456		// Two execution paths are being combined with different mutex lock states
-e457		// unprotected write access
-e458		// unprotected access
-e459		// unprotected access

///////////////////////////////////////////////////////////////////////
// General stylistic issues
-e663		// Suspicious array to pointer conversion
-e574		// Signed-unsigned mix with relational
-e641		// Converting enum '...' to int
-e716		// while(1) ...
-e726		// Extraneous comma ignored
-e728		// Symbol ... not explicitly initialized
-e737		// Loss of sign in promotion from int to unsigned int
-e763		// Redundant declaration for symbol '...' previously declared
-e717		// do ... while(0);
-e777		// Testing floats for equality
-e785		// Too few initializers for aggregate
-e786		// String concatenation within initializer

-e788		// enum constant '___' not used within defaulted switch

-esym(818, argv)	// Pointer parameter '...' could be declared as pointing to const

-e850		// loop variable modified in loop

/*
 * va_list's are opaque for a reason, but we pretend to FlexeLint that it
 * is just a void*, so it proposes constification, which is not generally OK,
 * for instance on register-spilling architectures.
 * XXX: Maybe 'ap' is a badly chosen conventional name here...
 */
-esym(818, ap)		// Pointer parameter '...' could be declared as pointing to const

-efunc(789, main)	// Assigning address of auto variable '...' to static

// +e958		// padding

///////////////////////////////////////////////////////////////////////
// System/Posix/Iso-C library related

-emacro(747, isnan)     // significant coercion

// ignore retval
-esym(534, printf)
-esym(534, fprintf)
-esym(534, vfprintf)
-esym(534, sprintf)

-esym(534, memset)
-esym(534, memcpy)
-esym(534, memmove)

-esym(534, strcat)
-esym(534, strcpy)
-esym(534, strncpy)

-esym(534, sleep)
-esym(534, usleep)


///////////////////////////////////////////////////////////////////////
// Vmod/vmodtool.py

-esym(14, vmod_enum_*)		// Symbol '___' previously defined (___)
-esym(759, vmod_enum_*)		// header declaration for symbol '___' defined at (___)
-esym(765, vmod_enum_*)		// external '___' (___) could be made static

///////////////////////////////////////////////////////////////////////
// <vut.h>

-sem(VUT_Error, r_no)

///////////////////////////////////////////////////////////////////////
// <vas.h>

-sem(VAS_Fail, r_no)		// does not return
-emacro(506, assert)		// constant value boolean
-emacro(827, assert)		// loop not reachable
-emacro(774, assert)		// boolean always true
-emacro(731, assert)		// boolean arg to eq/non-eq
-emacro(731, xxxassert)		// arg to eq/non-eq
-emacro(527, WRONG)		// unreachable code
-emacro(774, VALID_OBJ)		// boolean always true

///////////////////////////////////////////////////////////////////////
// Places where we use x<<0 for reasons of symmetry

-emacro(835, VCT_SP)		// A zero has been given as ___ argument to operator '___'
-emacro(835, VSL_COPT_TAIL)	// A zero has been given as ___ argument to operator '___'
-emacro(835, SLT_F_UNUSED)	// A zero has been given as ___ argument to operator '___'
-emacro(835, ARGV_COMMENT)	// A zero has been given as ___ argument to operator '___'
-emacro(835, F_SEEN_ixIX)	// A zero has been given as ___ argument to operator '___'
-emacro(835, VEX_OPT_CASELESS)	// A zero has been given as ___ argument to operator '___'

///////////////////////////////////////////////////////////////////////
// <vsb.h>

-esym(759, VSB_*)		// header decl could be moved
-esym(765, VSB_*)		// extern could be made static
-esym(714, VSB_*)		// symb not ref
-sem(VSB_new, @p == (1p ? 1p : malloc(1)))
-sem(VSB_delete, custodial(1))

// ignore retval
-esym(534, VSB_cat)
-esym(534, VSB_bcat)
-esym(534, VSB_putc)
-esym(534, VSB_printf)
-esym(534, VSB_vprintf)
-esym(534, VSB_putc)

///////////////////////////////////////////////////////////////////////
// <vtree.h>

-emacro(801, VRB_*)		// goto considered bad
-esym(534, *_VRB_REMOVE)	// ignore retval
-esym(534, *_VRB_INSERT)	// ignore retval

///////////////////////////////////////////////////////////////////////
// <vqueue.h>

-esym(755, VLIST_*)	// Global macro not ref.
-esym(755, VSLIST_*)
-esym(755, VSTAILQ_*)
-esym(755, VTAILQ_*)

// 506 = constant value boolean
-emacro(506, VTAILQ_FOREACH_REVERSE_SAFE)
-emacro(506, VTAILQ_FOREACH_SAFE)
-emacro(506, VSTAILQ_FOREACH_SAFE) // constant value boolean

// 826 = Suspicious pointer-to-pointer conversion (area to o small)
-emacro((826), VTAILQ_LAST)
-emacro((826), VTAILQ_PREV)

-emacro(740, VTAILQ_LAST) // Unusual pointer cast (incompatible indirect types)
-emacro(740, VTAILQ_PREV) // Unusual pointer cast (incompatible indirect types)

-esym(754, "*::vtqh_first")	// local struct member '...' not referenced

///////////////////////////////////////////////////////////////////////
// <vdef.h>
-emacro(527, NEEDLESS)	// unreachable code

///////////////////////////////////////////////////////////////////////
// <libvarnishapi>

-esym(765, vsl_vbm_bitclr)
-esym(759, vsl_vbm_bitclr)
-esym(765, vsl_vbm_bitset)
-esym(759, vsl_vbm_bitset)
-esym(765, vsm_diag)
-esym(759, vsm_diag)

///////////////////////////////////////////////////////////////////////
// "miniobj.h"

-emacro(774, REPLACE)


// It is ok to default after handling a few select SLT_* tags
-esym(788, VSL_tag_e::SLT_*)	//  enum constant '...' not used within defaulted switch

-esym(785,VSL_tags)				// Sparse array

///////////////////////////////////////////////////////////////////////
// readline etc.

-esym(534, add_history)

///////////////////////////////////////////////////////////////////////
// -lcurses
-esym(534, beep)
-esym(534, curs_set)
-esym(534, delwin)
-esym(534, doupdate)
-esym(534, endwin)
-esym(534, initscr)
-esym(534, intrflush)
-esym(534, keypad)
-esym(534, mvprintw)
-esym(534, waddnstr)
-esym(534, mvwprintw)
-esym(534, nodelay)
-esym(534, noecho)
-esym(534, nonl)
-esym(534, raw)
-esym(534, waddch)
-esym(534, wattr_off)
-esym(534, wattr_on)
-esym(534, wbkgd)
-esym(534, werase)
-esym(534, wmove)
-esym(534, wnoutrefresh)
-esym(534, wprintw)
-esym(534, wredrawln)
-esym(534, wrefresh)

///////////////////////////////////////////////////////////////////////
// Noise reduction, review periodically

-e459	// unlocked access from func-ptr
-e679	// Suspicious Truncation in arithmetic expression combining with pointer
-e712	// Loss of precision (___) (___ to ___)
-e713	// Loss of precision (___) (___ to ___)
-e732	// Loss of sign (___) (___ to ___)
-e734	// Loss of precision (___) (___ bits to ___ bits)
-e747	// Significant prototype coercion (___) ___ to ___
