




								  CLint V3.49
								  

					  The Ultimate C Source Checking Tool

			  (c) 1991, 1995 R&D Associates - All Rights Reserved


		  Ŀ
		  															 
		  				R&D Associates can be contacted on			 
		  				   COMPUSERVE by mailing user ID:			 
		  															 
		  						100013,1042 (USA)					 
		  					  100111,1162 (Europe)					 
		  															 
		  


	 This version of CLint	is released as SHAREWARE.  This means that	you
	 use it on a  try-before-you-buy basis. If you	find CLint useful,	you
	 must register within 30 days. We'll then send you the latest  version,
	 with more documentation, and you'll receive  news of updates and  full
	 technical support. R&D Associates regrets that it is unable to provide
	 full support for it's shareware products without registration.  Please
	 read the file LICENSE.DOC for more details.

	 CLint costs just  US$35 in the	 USA or Canada,	 and 19 in	 the UK	 or
	 Europe. Register today for an easier programming life. Please use	the
	 enclosed file ORDER.DOC.

									CONTENTS
									


	 What is CLint?.....................................................2
	 Installation.......................................................3
	 Update Record......................................................2
	 Configuring CLint..................................................4
	 Using CLint........................................................6
	 The Command Line Options...........................................7
	 Warnings...........................................................11
	 Specific Warning Options...........................................11
	 Advanced Options...................................................19
	 Control of Typedefs................................................21
	 Error And Warning Reports..........................................22
	 Alphabetic Ordering of Error & Warning Reports.....................22
	 Discussion Sections................................................51
		  Efficiency....................................................51
		  Coding Style..................................................53
		  Use of Typedef................................................54
		  Potentially Serious Bugs......................................55




									Page - 1
																CLINT V3.49

								 What is CLint?
								 

	 CLint is a tool that  reads the source files  of your C programs,	and
	 generates reports about possible problems. As	it can look at all	the
	 files in  your program,  it is	 able to  report far  more than	 any  C
	 compiler. Use	CLint while	 developing your  programs, and	 you'll  be
	 assured  of  type	 safe  linkage,	 efficient	 code,	and	  excellent
	 portability.

	 CLint understands all	the industry  standard extensions  to the  ANSI
	 standard such as near,	 far, huge, cdecl, pascal,	asm, and so on	for
	 all the supported compilers. It  understands and supports the	Borland
	 pseudo registers, and segment types, and the Microsoft special segment
	 control extensions.

	 A special feature of CLint is that it does not support memory	models.
	 Instead, all type modifiers are unique, that is:

		  char *	char far *			char near *			char huge *

	 and all variations are considered unique pointer types. The  advantage
	 is that regardless	 of the	 model you use	for any	 project, if  CLint
	 produces no warnings, then	 you can safely change	models with no	ill
	 effects. At the same  time, it understands that  near pointers may	 be
	 converted to far or huge  by default. For those  of you that have	had
	 problems with mixed model programming, this feature alone will justify
	 your purchase!

	 
	 NEW IN 3.45:  Missing	DOS extender  file added.  Ability to s uppress
	 degenerate unsigned compare messages added.  Minor bug fixes involving
	 'const' members of struct/union.
	 


								 Update Record.
								 

	 Version 3.25: A major upgrade rewritten entirely in C++. This	version
	 uses the Borland  DOS extender for	 extra speed.  The error  reporting
	 logic has	been  rebuilt to  get  more useful	and	 precise  messages.
	 Extensive testing using  using a large	 quantity of C	code from  many
	 sources has elliminated many irritating bugs in earlier versions.

	 Version 3.33: Enhancements and minor bug fixes from beta site reports.
	 Improved ANSI warnings.

	 Version 3.45:	Missing	 DOS extender  file added.	Ability to suppress
	 degenerate unsigned  compare messages added. Minor bug fixes involving
	 'const' members of struct/union.

     Version 3.49: Fixed -Z switch and long function detection.


									Page - 2
																CLINT V3.49

								  Installation
								  

	 To install this  version of CLint	insert the supplied	 CLint disk	 in
	 drive (we assume drive A: here), then type:

		  A:
		  CSETUP

	 CSETUP	 has  an  easy	to	use	 menu  interface.  Specify	the	 target
	 directory, select the	compiler you're using,  and specify where  your
	 compiler's header files live - you'll be given proposed names.	 CSETUP
	 fully supports	 your mouse,  and has  full on-line	 context  sensitive
	 help. It writes (or  updates if already  existing) the CLINT.CFG  file
	 according to your	choices, renaming  any existing	 CLINT.CFG file	 as
	 CLINTOLD.CFG. You can	use CSETUP	again at  any time	to change  your
	 choices.

	 CSETUP will automatically update  your AUTOEXEC.BAT file if  required,
	 renaming  the	original  file	AUTOEXEC.OLD.  You	may	 refuse	 CSETUP
	 permission to	change	it,	 in	 which	case  you  should  add	CLint's
	 directory to your path.

	 If you	 let  CSETUP  modify your  AUTOEXEC.BAT,  it  will	reboot	the
	 computer to allow the	changes to take	 effect, unless you're  running
	 Windows. If instead you  manually make the changes,  you will need	 to
	 re-boot.

			   PLEASE NOTE: If	you change your	 C compiler,  you
			   will need to run CSETUP	again to inform CLint  of
			   your new compiler configuration.

	 The registered version of CLint ships with libraries for all supported
	 compilers.	 For  ShareWare,  CSETUP  will	attempt	 to	 construct	the
	 required compiler specific	 CLB file for  you. If	CSETUP reports	any
	 problems building	this  file, you	 will  have to	make  it  manually;
	 possible editing  the	supplied  *.BAT	 and/or	 *.C  files.  For  each
	 supported configuration, there is a *.BAT file and a *.C file. Execute
	 the batch file	 in the CLint  directory, and check	 if any faults	are
	 reported. The most likely	cause of problems is  if one of the	 header
	 files CLint expects (but you don't  use) has been deleted. If this  is
	 the case, remove the #include lines  from the *.C file which refer	 to
	 the missing header.

	 If you continue to have problems of any kind, please send us E-mail at
	 the CompuServe address above, and we'll get you started.

	 If you told CSETUP that you're using an unsupported compiler, you must
	 carefully check the supplied files CGEN.BAT and CGEN.C. Both files may
	 need to be edited.	 CGEN.BAT may need editing	to add switches to	the
	 CLint command line. CGEN.C must be edited to have one #include	 "file"
	 line for each non-C++	header file supplied  by your compiler	vendor.
	 The standard version of  CGEN.C mentions all  the headers required	 by
	 the ANSI standard, but you should add others supplied by your	vendor.

									Page - 3
																CLINT V3.49

	 You should preserve the  original files by	 editing copies with  names
	 chosen to suit your  compiler. Finally, run the  batch file, copy	the
	 resulting CLB	file  back	to your	 CLint	directory,	and	 then  edit
	 CLINT.CFG making the -l switch refer to the newly built library.


							   Configuring CLint
							   

	 You can configure CLint  to your personal	preferences by editing	the
	 supplied CLINT.CFG file  which looks  like this  (varies according	 to
	 what you told CSETUP when CLint was installed):

	   #  (c) R&D Associates 1992-1994.
	   #  CLINT.CFG

	   -IC:\BORLANDC\INCLUDE  # Borland C++ 3.0 or 3.1
	   -lC:\CLINT\CBCPP31.CLB # CLint Library for Borland C++ 3.0 or 3.1

	   # Standard switches for Borland C++ 3.0 or 3.1
	   -D__TURBOC__ #??#

	   # Default warning settings:
	   -wtri	 # ON  warn about trigraphs
	   -wcom	 # ON  object to nested comments
	   -winc	 # ON  multiply included headers
	   -w-fbr	 # OFF for needs '{'
	   -w-wbr	 # OFF while needs '{'
	   -w-ibr	 # OFF if needs '{'
	   -w-ebr	 # OFF else needs '{'
	   -w-spc	 # OFF advise on spacing
	   -wiag	 # ON  auto aggregate initialise
	   -w-tye	 # OFF warn of typedefing enums
	   -w-tys	 # OFF warn of typedefed structs
	   -w-typ	 # OFF warn of typedefing ptr types
	   -w-tyb	 # OFF typedefing primitive types
	   -w-tyg	 # OFF warn of general typedefs
	   -wunr	 # ON  warn of unreachable code
	   -wstv	 # ON  of passed/returned structs
	   -welb	 # ON  warn of empty loop bodies
	   -wcon	 # ON  warn of constant conditions
	   -wmxp	 # ON  mixing signed/unsigned ptr
	   -whdr	 # ON  warn in user header files
	   -w-shd	 # OFF warn in system header files
	   -wprn	 # ON  warn of misuse of printf
	   -wcil	 # ON  long constants need L
	   -wenu	 # ON  warn of enum misuse
	   -wpro	 # ON  functions need prototypes
	   -wret	 # ON  warn of return misuse
	   -w-lfb100 # OFF functions > NNN lines
	   -wsig	 # ON  warn of loss of significance
	   -wlib	 # ON  library symbol redefined
	   -wlnf	 # ON  warn of field length > 16
	   -wreg	 # ON  warn of register usage

									Page - 4
																CLINT V3.49

	   -wpua	 # ON  possible unintended assign
	   -wbbr	 # ON  non-ANSI initializer bracing
	   -w-nac	 # OFF non-ANSI printf conversion
	   -w-ebb	 # OFF allow empty body with {}
	   -w-scg	 # OFF statics matching globals

	 CSETUP creates	 a	CLINT.CFG file	with  the default  warning	options
	 defined and commented for your convenience.

	 As you will see later, you can add or change any of CLint's options to
	 this file	as you	see fit.  But  don't remove  or change  the  '#??#'
	 markers or change any of the CSETUP supplied comments, or CSETUP won't
	 be able to make clean changes later. The '-I' line specifies the  name
	 of the directory where your compiler's header files are - change  this
	 as required, or use CSETUP. The '-l' line specifies where you keep the
	 library definitions, and the name of  the definition file. If you	use
	 CSETUP to change  your CLint  configuration, it  edits your  CLINT.CFG
	 file retaining all the information that did not need to be changed.

		 NOTE: You MUST specify complete pathnames with -I and -l, not
						relative! CSETUP enforces this.

	 CLint searches for	 CLINT.CFG in the  current directory,  then in	the
	 directory	containing	CLINT.EXE.	You	 should	 set  up  the  standard
	 CLINT.CFG file to reflect your general needs. If a special case arises
	 in one of your programs, simply copy CLINT.CFG to that directory:

		  CD MYDIR
		  COPY \CLINT\CLINT.CFG

	 and edit it as required. No other use of CLint will be affected. CLint
	 expects that each	line in CLINT.CFG  is a CLint  option which	 starts
	 with '-' and is followed by  an option letter, and any required  text.
	 Any number of	other lines	 may be	 present in	 the file  and will	 be
	 ignored. You can also comment any line by using '#' like this:

		  -l\clint\cbcpp31	  # BorlandC++ 3.1

	 Such comments are ignored. CLint is insensitive to case in the command
	 line or in CLINT.CFG except as detailed later.

	 The configuration options	you're most likely  to want involve  adding
	 additional -I lines  to refer	to additional  vendor supplied	library
	 header files,	-l	options to	refer  to CLint	 library  files	 you've
	 constructed yourself,	and	 enabling  or disabling	 certain  types	 of
	 warnings. To better  understand which warnings	 you'll need, read  the
	 discussion sections - particularly the STYLE section.

	 Each project you work	on is likely to	 have specific needs. The  best
	 way to handle	these needs	 is to create  a PROJECT.CLN  file in  each
	 project directory (as described later) containing specific options for
	 the project. You should place common options used by all your projects
	 in CLINT.CFG in your CLint directory.


									Page - 5
																CLINT V3.49

								  Using CLint
								  

	 In the simplest case, you will use CLint like this:

		  CLINT *.C

	 CLint will read all of the	 source files, analyze them carefully,	and
	 report on any possible problems, ANSI violations, portability problems
	 and so forth. It assumes that all the files specified are part of	one
	 program, and will be linked together, and linked with the vendor  run-
	 time library routines specified in CLINT.CFG  or with '-l' options	 on
	 the command line.

	 It checks carefully  that symbols	declared in	 one file  and used	 in
	 another have the same	declaration in both	 files; that all  functions
	 defined are actually called; that all	variables defined are used.	 If
	 CLint produces no	warnings or errors	about such things,	you can	 be
	 assured that the program when linked is type-safe.

	 There may be cases where you have run-time libraries supplied by other
	 vendors, or written  by yourself. You	will need to  tell CLint  about
	 them to obtain full checking. If you don't, CLint will complain  about
	 symbols which are never defined. Let's assume that you have a  library
	 called MYLIB in \MYLIB, which has a header MYLIB.H. The first thing to
	 do is verify that there are no errors in MYLIB:

		  CD \MYLIB
		  CLINT *.C -u

	 Fix any errors reported before proceeding! Then you do:

		  CLINT MYLIB.H -L MYLIBDEF.CLB

	 And finally you add the line:

		  -l\MYLIB\MYLIBDEF.CLB

	 to CLINT.CFG. (If you don't want to add this line, simply type the '-
	 l' option when you run CLint). The really important options you may
	 need to use are:

		  -Dname=value	 define a preprocessor macro
		  -Uname		 undefine a preprocessor macro
		  -lfile		 specify a CLint library file to check against
		  -Ipath		 tell CLint where to find header files

	 When  reading	header	files,	 CLint	distinguishes  between	 header
	 directories specified in CLINT.CFG, and those specified in the command
	 line. The former  are assumed to  be your compiler	 or library	 header
	 files, the latter header files which are part of the program. This	 is
	 only important	 when  '-w-shd'	 is used  (don't  warn  about  compiler
	 headers - the default), as CLint will only be silent on minor problems
	 in compiler headers - not program ones.

									Page - 6
																CLINT V3.49


	 The built-in preprocessor	is a full  ANSI implementation. It	defines
	 the required preprocessor macros:

		  __LINE__, __FILE_, __DATE__, __TIME__

	 and also the macros:

		  __DOS__ and __CLINT__

	 with the value '1'. If you require __STDC__ place '-D__STDC__' on	the
	 command line or  in CLINT.CFG.	 Some users	 have encountered  problems
	 with compilers	 which claim  to be	 ANSI, but	don't have  fully  ANSI
	 preprocessors. Lines like:

		  #if (sizeof(int) == sizeof(short))

	 often in LIMITS.H are a dead giveaway. The ANSI standard  specifically
	 prohibits expressions	like this:	you can't  have casts,  sizeof,  or
	 enumeration constants in a #if expression, but CLint allows this  with
	 the -G option switch.

	 Alternatively, create a file PROJECT.CLN for your project containing a
	 line for each source  file in the project.	 You should also place	any
	 project specific options using '-I', '-l', '-w' etc. one per line with
	 no spaces (see the next section for details).

	 Having created	 PROJECT.CLN, and  if you  use MAKE,  you may  find	 it
	 convenient to add a target:

		  clint:
			   clint -o report.txt


	 to your MAKEFILE completely check your	 entire project, and leave	the
	 report in 'REPORT.TXT'.

						   The Command Line Options.
						   

	 CLint takes a number  of source file  names, possibly with	 wildcards,
	 and analyses these sources. To control	 the analysis and reporting,  a
	 number	 of	 options  may  occur  on  the  command	line,  or  in	the
	 configuration file CLINT.CFG,	or in  files with  a '.CLN'	 extension.
	 PROJECT.CLN is special, if no files are specified and that file exists
	 it is used by default.	 The filenames may be  specified in full or	 in
	 part. Filenames with no  extension are assumed	 to have the  extension
	 '.C', failing which they are assumed to have the extension '.CLN'. The
	 files are inspected in order of their occurrence on the command  line.
	 When wild	card  expansion	 occurs, the  expanded	names  are	ordered
	 alphabetically.

	 File names with  no wildcards	and no	extension if  not matching	any
	 files with the extension '.C' have the extension '.CLN' appended,	and
	 are then  searched	 for  in the  current  directory.  Files  with	the

									Page - 7
																CLINT V3.49

	 extension '.CLN'  are	assumed to	contain	 command line  options	and
	 filenames, one per	 line. If  filenames are  present in  the file,	 no
	 wildcards are permitted, neither are  nested '.CLN' files. Such  files
	 are supported to allow	 the convenient specification  of the group	 of
	 files comprising a project and the options they need. You may have any
	 number of blank lines	in the file,  and you can  add comments to	any
	 line by prefixing them with the '#' character.

	 Such files are	 read strictly in  left to right  order as	encountered
	 while reading the command line. The  effect is exactly as though  each
	 line of the '.CLN'	 file is inserted as  an argument into the	command
	 line replacing the '.CLN' filename argument. In subsequent discussion,
	 all comments regarding the precedence of command line options includes
	 any options also found in '.CLN' files.

	 All CLint	options begin  with a  leading '-'	or '/'	character -	 in
	 examples we  use '-'.	Except as  described  below, options  are  case
	 insensitive  unless  the  C  standard	or	operating  system  requires
	 otherwise. Options	 may  occur	 in any	 order	on	the	 command  line,
	 intermixed with  file	names.	The options	 are  read	in	the	 order:
	 CLINT.CFG and then command line left-to-right which can be	 important.
	 Options in	 the command  line may	override  options in  CLINT.CFG	 or
	 earlier options in the command line.

		  NOTE: CLint  searches for	 CLINT.CFG	first in  the  current
		  directory, and then in  the directory containing	CLINT.EXE.
		  CLint issues no warnings if CLINT.CFG can't be found.
	 
	 -Ipath
	 -ipath
		  where 'path'	is	a directory	 name.	Case may  be  important	 in
		  directory names depending	 on the	 operating system  you use.	 It
		  specifies a directory to search for header files. There may be as
		  many of these options as required. The order of search for:

			   #include "file"
		  is
			   directory containing the source file,
			   current directory,
			   -I directories given on the command line,
			   -I directories given in a CLN file,
			   -I directories given in CLINT.CFG.
		  and for:
			   #include <file>
		  is
			   -I directories given on the command line,
			   -I directories given in a CLN file,
			   -I directories given in CLINT.CFG.

		  You can force CLint to forget all the -I options in CLINT.CFG	 or
		  a CLN file by giving '-I-' or '-i-' on the command line prior	 to
		  any other include paths.



									Page - 8
																CLINT V3.49

	 
	 -Dname
	 -dname
	 -Dname=value
	 -dname=value
		  These options	 define preprocessor  macros. Although	the	 option
		  letter is case insensitive, the macro	 names and values are  NOT.
		  The first form defines a macro with default replacement text '1'.
		  The second form gives the	 replacement text explicitly. For  your
		  convenience, you may append several definitions to an option with
		  ';' like this:

			   -Dname1;name2=4;name3=5;name4

		  Note that the DOS command line can't handle options like:

			   -Dname="1"

		  properly.
	 
	 -Uname
		  This option deletes a preprocessor macro.	 It is not an error	 to
		  specify a macro which was not defined. It is an error to	attempt
		  to undefine:

			   '__TIME__', '__DATE__', '__FILE__', or '__LINE__'.

		  But it can be used to undefine

			   '__CLINT__' or '__DOS__'

		  or any symbols defined in CLINT.CFG. As with '-D' you can	 append
		  several names with ';' like this:

			   -Uname1;name2

		  The order of '-D' and '-U'  is important - you may only  undefine
		  macros whose definition precedes the '-U' option.
	 
	 -o file
	 -O file
	 -ofile
	 -Ofile
		  This option  specifies  a	 file to  receive  CLint's  output.  By
		  default the  output  is written  to  'stderr'. If	 you  use  this
		  option, CLint still writes the source file name it is working	 on
		  to 'stderr' to show you how it is proceeding. If more than one of
		  these options occur, the rightmost one is used.
	 
	 -e0
		  By default CLint stops reading a file if 15 errors are  produced,
		  and proceeds to the next file with the message 'Too many errors'.
		  If you use this option the limit is removed.


									Page - 9
																CLINT V3.49

	 
	 -eNNN
		  Use this option to specify the error limit you need. The	default
		  is 15. If this option and '-e0' occur together, the rightmost one
		  is obeyed. The maximum specific value you can give is 255.
	 
	 -u
		  This option informs CLint	 that the set  of files is	incomplete,
		  and to not simulate a linker	and warn about undefined or	 unused
		  symbols.
	 
	 -T
		  This option requests that CLint notify  you of all symbols  which
		  could be static because they are only used in one file. -wsgs has
		  the same meaning.
	 
	 -Jname
		  This option  informs CLint  that the	named environment  variable
		  contains one or  more directory names	 to be used	 to search	for
		  included files. These names are used exactly as though  specified
		  by -I in CLINT.CFG.
	 
	 @file
		  This option  is  taken  to be	 a	file  containing  command  line
		  arguments for	 CLint.	 Each argument	must  appear   on  separate
		  lines. Blank lines or comments introduced with '#' may occur.
	 
	 -3
		  This option makes CLint consider integers to be 32 bit.
	 
	 -G
		  This option supports the Archimedes HC11 compiler by making '$' a
		  legal identifier character, and allowing sizeof and casts in #if.
	 
	 -Y
		  This option  enables 'extern  register' as  a storage	 class	for
		  controller compilers like the Intel I96.
	 
	 -H
		  This option disables the Borland style psuedo registers _AX,	_BX
		  etc. This must be disabled for the Mix PowerC compiler.
	 
	 -C
		  This option allows C	comments to nest. If  used, -wcom (warn	 of
		  nested comments) has no effect.










								   Page - 10
																CLINT V3.49

									Warnings
									
	 -w0
	 -W0
		  By default,  CLint  stops	 reading a	file  if  60  warnings	are
		  produced, and proceeds  to the next  file with  the message  'Too
		  many warnings'. If you use this option the limit is removed.
	 
	 -wNNN
		  Use this	option	to specify	the	 warning limit	you	 need.	The
		  default is  60. If  this option  and	'-w0' occur	 together,	the
		  rightmost one is obeyed. The maximum specific value you can  give
		  is 255.
	 
	 -wall
		  A number of CLint's  warnings are optional,  and OFF by  default.
		  This turns all warnings on.
	 
	 -w-all
		  This turns all warnings off. It  may usefully occur in  CLINT.CFG
		  when followed by '-wxxx' options to  turn on only those  warnings
		  you need.
	 
	 -wxxx
		  Turn the specified warning on.
	 
	 -w-xxx
		  Turn the specified warning off.


						   Specific Warning Options.
						   

	 -wtri	   (trigraphs)
		  On by default. This enables  warnings about ANSI trigraphs.  This
		  capability was  added to	the standard  to allow	users with	old
		  style input  devices to  create characters  not present  on  such
		  keyboards. The  standard further	states	that scanning  for	and
		  replacement of trigraph sequences precedes all other	operations,
		  so trigraph replacement  occurs in comments.	CLint however  does
		  not warn about trigraphs in comments.

		  ??=	replaced by '#'
		  ??/  replaced by '\'
		  ??'  replaced by '^'
			   replaced by '['
			 ??(
		  ??)  replaced by ']'
		  ??!  replaced by '|'
		  ??<  replaced by '{'
			   replaced by '}'
			 ??>
		  ??-  replaced by '~'




								   Page - 11
																CLINT V3.49

	 
	 -wcom	   (comments)
		  On by default. This causes CLint	to object to C comments	 nested
		  inside C comments like this:

			   /*		 */
					/*		  */

		  The  standard	 specifically  states  that	 comments  don't  nest.
		  However, if you use the -C switch, CLint allows comments to  nest
		  and  disables	 this  warning.	 CLint	also  supports	C++	  style
		  comments.

	 
	 -winc	   (included files)
		  On by default. This causes CLint to object when a header file	 is
		  directly or indirectly included more than once - this means  that
		  if you include a	header which re-includes  a header you	already
		  included, you'll get a warning. This warning is given to try  and
		  improve compile  times -	multiply including	headers wasts  your
		  time, although with  properly written	 headers there	won't be  a
		  problem. However,	 older compilers  sometimes have  header  files
		  which don't  comply  with  the ANSI  requirements,  and  multiple
		  inclusion can cause problems.

	 
	 -wfbr	   (for requires brace)
		  Off by default. When	enabled, CLint objects	to a for  statement
		  where the inner loop body is not braced like this:

			   for (i = 0; i < 5; i++)
					j = i;

		  We consider that all	loop bodies should	be braced for  clarity.
		  CLint won't object to  an empty loop body  if it simply the  null
		  statement ';
                     ;
                     ;'. You may prefer that empty loop bodies use '{}', in
		  which case you should enable -webb described below.

	 
	 -wwbr	   (while requires brace)
		  Off by default. As for -wfbr above, except for 'while' loops.

	 
	 -wibr	   (if requires brace)
		  Off by default. As for -wfbr above, except for 'if'.

	 
	 -webr	   (else requires brace)
		  Off by default. As for -wfbr above, except for 'else'.







								   Page - 12
																CLINT V3.49

	 
	 -wspc	   (advise on space usage)
		  Off by default. When	this switch is on,	CLint objects to  'if',
		  'return', 'switch',  'for', 'while',	and	 'do' not  followed	 by
		  white space; and to '=' (assignment), ':' (colon), '?'  (question
		  marrk), ';' (semicolon),	and ',' (comma)	 not followed by  white
		  space unless directly followed by ')' or ';'. These warnings	are
		  intended to highlight coding styles which	 are dense and hard	 to
		  read. It particularly applies to constructs like:

			   if(i)

		  which looks enough  like a function  call to confuse	the eye	 at
		  first glance.

	 
	 -wiag	   (initializing auto aggregates)
		  On by default. CLint considers initializing automatic	 aggregates
		  (structures or arrays) to be wasteful. Be aware that when you	 do
		  this, the compiler generates a hidden unnamed copy of the object,
		  and then copies that object over your automatic variable on  each
		  function entry. If you don't  modify the object, consider  making
		  it static.

	 
	 -wtye	   (typdef of enum)
		  Off by defualt. When enabled, CLint considers it poor practice to
		  typedef an enumerated type, as this makes it hard to	destinguish
		  an enumerated type from other types when reading the source.

	 
	 -wtys	   (typedef of structs)
		  Off by  default. When	 enabled,  CLint considers	that  typdefing
		  structures without at least a leading capital to be  missleading.
		  The form -wtysU requests CLint to	 object to such typedefs  which
		  are not fully in uppercase.

	 
	 -wtyp	   (typedef of pointers)
		  Off by  default.	When  enabled, CLint  objects  to  typedefs	 of
		  pointer types,  on  the  grounds that	 too  much	information	 is
		  hidden.

	 
	 -wtyb	   (typedef of basic types)
		  Off  by  default.	 When  enabled,	 CLint	objects	 to	 typedefing
		  primitive types  like 'int'  other than  in  lower case,	on	the
		  grounds of possible confusion.

	 
	 -wtyg	   (typedef of general types)
		  Off by default.  When enabled,  CLint objects	 to overly	complex
		  typedefs such	 as	 pointers  to functions,  and  arrays,	on	the
		  grounds of possible confusion.

								   Page - 13
																CLINT V3.49


	 
	 -wunr	   (unreachable code)
		  On by default. CLint considers code which can't be reached to  be
		  a problem. In some obscure cases	(such as jumping into the  body
		  of a loop that can't be  entered from the top), CLint's  analysis
		  is wrong. In such cases you can silence CLint's objectsions with:

			   #pragma notreached

		  which informs CLint that this is intentional.

	 
	 -wstv	   (struct/union passed/returned value)
		  On by default. When  you pass or return  a structure value,  slow
		  code which uses additional stack space at least equal to the size
		  of the object	 is generated. Also,  some earlier compilers  could
		  not correctly	 generate code	for recursive  functions when  this
		  occurred.

	 
	 -welb	   (empty loop bodies)
		  On by	 default.  CLint  considers that  empty	 bodies	 of	 'for',
		  'while',	'do',  'if',  or  'else'  statements  is  wasteful	and
		  possibly a bug, unless such empty	 bodies are the null  statement
		  ';'. If you prefer to use '{}' for empty bodies, use -webb.

	 
	 -wcon	   (constant condition)
		  On by default. CLint considers that conditional expressions which
		  evaluate to constants is wasteful and possibly a bug. It	objects
		  to statement like:

			   if (1 >= 0)

		  (which might arise from macro expansion) as a constant condition,
		  and to:

			   unsigned j;
			   while (j > 0)

		  as a degenerate comparison, since	 unsigned values can't ever  be
		  negative: such  comparisons  are	equivalent	to	comparison	for
		  equality with 0.











								   Page - 14
																CLINT V3.49

	 
	 -wmxp	   (mixing pointers to different char types)
		  On by	 default.  CLint  considers 'char',	 'unsigned  char',	and
		  'signed char' to be different types,	so it complains of the	use
		  of a pointer	to one	of these  when another	was specified  like
		  this:

			   char *cp;
			   unsigned char *ucp;

			   cp = ucp;

		  Although all char	 types are the	same size, the	effect of  sign
		  extension when the values are used can cause problems unless	you
		  are quite specific about which type you use. You can silence this
		  objection with a cast.

	 
	 -whdr	   (warn in user headers)
		  On by default.  CLint considers  that warnings  should be	 issued
		  about dubious practices  in your	headers files,	on the	grounds
		  that headers are your code too.

	 
	 -wshd	   (warn in system headers)
		  Off by default. CLint suppresses warning about dubious  practices
		  in system	 header files  because	unfortunately too  many	 vendor
		  headers would otherwise produce a barrage of objectionns.

	 
	 -wprn	   (check printf/scanf)
		  On  by  default.	CLint  warns  checks  the  format  strings	and
		  arguments of printf(),  fprintf(), sprintf(), scanf(),  fscanf(),
		  and sscanf()	according  to  the	ANSI  requirements.	 All  these
		  functions can be a prolific source of problems in your code,	and
		  you should never disable this.

	 
	 -wcil	   (constant is long)
		  On by default. CLint objects to constants like 1234567 which	are
		  outside the range	 which can	be handled	by an  'int' type.	For
		  values in the range 32768 through 65535 which can be placed in an
		  'unsigned int', you can use the suffix 'U', otherwise you	 should
		  use the suffix 'L'.

	 
	 -wenu	   (check enumeration usage)
		  On by default.  CLint checks all	comparisons and assignments	 of
		  enumerated types, and objects if the	values used are members	 of
		  different enumerations,  or not  enumerations. You  can  suppress
		  these warnings with casts.




								   Page - 15
																CLINT V3.49

	 
	 -wpro	   (call requires prototype)
		  On by default. CLint	considers that all	function calls must	 be
		  made to functions which have been previously been prototyped.	 If
		  you have difficulty construction these prototypes, consider using
		  the -p option to generate the prototypes for you.

	 
	 -wret	   (check return)
		  On by default. CLint checks that all functions return the	 values
		  they are supposed to. It	objects to missing 'return'	 statements
		  on functions which should return values, and on both returning  a
		  value and not returning a value in the same function.

	 
	 -wlfb[NNN]		(long function bodies)
		  Off by  default.	When enabled,  CLint  will inform  you	of	any
		  functions it sees with more than	NNN lines (or 100 lines if	NNN
		  is not  specified). This	helps  identify large  functions  which
		  should perhaps be simplified by breaking into subroutines.

	 
	 -wsig	   (possible loss of significance)
		  On by default.  CLint considers  assignment of  'long' values	 to
		  shorter integral types without a cast to be a possible error. The
		  form -wsig+  considers assignment	 of any	 type larger  than	the
		  destination to be a possible error.

	 
	 -wlib	   (symbol hides library definition)
		  On by default. CLint considers that  if you define a function	 or
		  symbol which is  defined in your	vendor's runtime library,  that
		  this is a possible error. Sometimes  you must provide a  function
		  of the same name which then hides the runtime library definition,
		  in which	case you  should accept	 the  warning or  disable  this
		  option.

	 
	 -wlnf	   (long field)
		  On by default. CLint considers int  objects to be 16 bits	 unless
		  you use the -3 (32 bit integers) switch, and then objects to bit-
		  fields longer than  16 bits. You	should be aware	 that the  ANSI
		  standard leaves  all	aspects of	bit	 fields to	the	 vendor	 to
		  implement as	they see  fit, so  code using  bit fields  must	 be
		  considered highly non-portable.










								   Page - 16
																CLINT V3.49

	 
	 -wreg	   (register used)
		  On by	 default. CLint	 warns	about all  'register'  declarations
		  because with modern  compilers you are  almost always better	off
		  leaving the compiler to decide how to use registers. Legacy  code
		  often used  register	declarations  to try  and  force  primitive
		  compilers to	generate  slightly	faster code,  but  with	 modern
		  compilers you will almost always force the compiler (if it honors
		  register requests) to generate worse code.

	 
	 -wpua	   (possibly unintended assignment)
		  On by	 default.  CLint  considers	 assignment	 in	 a	conditional
		  context where the result is not compared with a constant to be  a
		  possible error, for example:

			   if (i = 5)

		  might well have been intended to be:

			   if (i == 5)

		  However, if such assignments are written as:

			   if ((i = 5) != 0)

		  then CLint considers this to be an intended assignment.

	 
	 -wbbr	   (non ANSI initializer bracing)
		  On by default. The  ANSI standard considers  it good practice	 to
		  enclose each substructure element in an initialization in	 braces
		  (as for example when initializing an array of structures).  CLint
		  warns if this is not done.

	 
	 -wnac	   (non ANSI printf/scanf conversion)
		  Off by default.  Most DOS compilers  extend printf() and	scanf()
		  conversions to allow	the use of	'N' (near) and	'F' (far)  when
		  specifiying a pointer format. These are non-ANSI conversions, and
		  will cause a complaint if you enable this option.

	 
	 -webb	   (empty body is braces)
		  Off by default. When	any of -wfbr, -wwbr,  -wibr, and -webr	are
		  used, CLint complains about empty loop  bodies which are not	the
		  null statement ';'. If you prefer	 '{}' as your empty loop  body,
		  enable this option.







								   Page - 17
																CLINT V3.49

	 
	 -wnub	   (unreachable break allowed)
		  Off by default. When -wunr is enabled (see earlier), CLint  warns
		  of unreachable statements.  However, your	 local coding  standard
		  may require that all cases in a switch end with break even if not
		  reachable. If you enable this option, such break statements won't
		  provoke an unreachable code warning. For example:

			   switch (j)
			   {
			   case 1:
					return;
					break;
			   }

	 
	 -wsgs	   (suggest statics)
		  On by default. After reading all	source files, CLint checks	all
		  symbols for compatible definitions in each of the file, and  with
		  the runtime  library. During	this  check, any  globally	visible
		  symbols used	in	only  one file	are	 noted	as	being  possible
		  'static' symbols.

	 
	 -wscg	   (static collides with global)
		  Off by default. After reading all source files, CLint checks	all
		  symbols for compatible definitions in each of the file, and  with
		  the runtime  library. During	this  check, any  globally	visible
		  symbols with the same name as 'static' symbols causes a  warning.
		  You should probalby change the name of the static symbol to avoid
		  possible problems.
























								   Page - 18
																CLINT V3.49

								Advanced Options
								
	 -L file
	 -Lfile
		  This important option instructs CLint to change it's behavior, in
		  that it knows the source files will be headers not program  text.
		  Each prototype or	 external declaration  in the  source files	 is
		  written to the 'file' in a form to be later read into CLint using
		  the '-l' option. By convention, all such files should have a	CLB
		  extension, but the extension is not enforced.

		  Note that many errors will be reported if this option is	applied
		  to program source, and that the '-L' MUST be upper case. The file
		  name case is only important if your operating system requires.

	 
	 -l file
	 -lfile
		  This option instructs CLint to read a definition file	 previously
		  prepared with the '-L' option above after reading all the	 source
		  files. Declarations  and	usage  in your	source	files  will	 be
		  compared to those recorded in the definition file, and may result
		  in the warning:

		  Warning: 'name' in file(NNN) hides a library symbol in 'file'

		  If this happens, you have defined a function or variable which is
		  also defined in a	 library. C allows this,  but in some cases	 it
		  may be a bug in your code. You may suppress this warning with the
		  '-w-lib' option.

		  You may also specify	a directory with -l	 which is added to	the
		  list of directories searched by  later -l switches. For  example,
		  if you have several CLint libraries in:

			   \CLINT\MYLIBS

		  If you want CLint to check  usage in ALIB in this directory,	you
		  use:

			   -l\clint\mylibs

		  (possibly in CLINT.CFG or a CLN file) and then use:

			   -lalib.clb

		  Then CLint knows this refers to \CLINT\MYLIB\ALIB.CLB.

	 
	 -p
	 -P
		  Write prototypes of all externally visible functions declared	 in
		  your source files to 'stdout'.


								   Page - 19
																CLINT V3.49

	 
	 -pfile
	 -Pfile
		  Write prototypes of all externally visible functions declared	 in
		  your source files to 'file'.

	 
	 -E
		  Use CLint	 as a  modified ANSI  C	 pre-processor. The	 output	 is
		  written to 'stdout' and may be redirected, or the '-o' option may
		  be used to write the output to any named file. If wild cards	are
		  used, each source file is pre-processed in turn resulting in	all
		  output appearing in the same file. Comments are preserved in	the
		  output. Innclude files are read for the definitions they contain,
		  but are not  included in the	output. The output	may have  #line
		  directives where many blanks lines were removed from the source.

	 
	 -u
		  This switch informs CLint that the files given are not  complete:
		  either they are a library or only part of a program. In any case,
		  complaints about symbols	used but not  defined, and defined	but
		  not used are suppressed.

	 
	 -T
		  This switch tells CLint to  detect functions and variables  which
		  are only used	 in the file  in which they	 are declared. It  then
		  prints a warning	about all such	variables, observing that  they
		  should be declared  'static'. This cna  also be  achieved with  -
		  wsgs.

	 
	 -Y
		  This switch instructs CLint to allow	'extern register' as a	new
		  storage class. This storage class is often used by compilers	for
		  controllers.

	 
	 -Jname
	 -jname
		  This option specifies the name  of an environment variable  which
		  contains a set  of semi-colon seperated  search paths for	 header
		  files. You  can place	 this option  on the  command line,	 or	 in
		  CLINT.CFG, or a CLN file.










								   Page - 20
																CLINT V3.49

							  Control of Typedefs
							  

	 'typedef' is  often misused.  You can	control the	 way CLint	reports
	 these misuses in a number of ways:

	 
	 -wtye enables reports of typedefing enums, for example:

		  typedef enum { A, B} THING;

	 provokes  the	report:	 "typedefed  enum  as  'THING'".  We   consider
	 typedefing enums to  be poor practise	as discussed elsewhere,	 except
	 for the example given below.

	 
	 -wtys enables reports	about typedefing structs  or unions without	 an
	 initial capital letter in the name, -wtysU enables reports about  this
	 without the name being all upper  case. We consider that at least	the
	 name should start with a capital letter, preferably all upper case.

	 
	 -wtyp enables reports about typedefing pointer types. We consider this
	 to be one of the major abuses of typedef.

	 
	 -wtyg enables reports about strange typedefs - for example	 typedefing
	 an array. We  produce this message	 for any typedef  which is	complex
	 (not a	 primitive	type, struct,  union,  enum, or	 pointer).	Complex
	 typedefs  are	in	our	 opinion  dangerous	 as	 they  hide	 too   much
	 information.

	 
	 -wtyb enables reports about typedefing	 primitive types such as  'int'
	 with names that are not all lower case. There are occasions where this
	 is useful, but	 we believe that  for clarity the  typedef name	 should
	 always be lower case.

	 CLint already knows about standard ANSI names which are typedefed,	 as
	 follows:

			   div_t, ldiv_t, size_t, wchar_t, clock_t, time_t,
			   fpos_t, jmp_buf, va_list, tm,

	 and will never complain about their definitions. It also knows all the
	 definitions in WINDOWS.H, and won't complain about them either.









								   Page - 21
																CLINT V3.49

						   Error And Warning Reports
						   

	 There are	many possible  warnings and	 errors	 - these  are  detailed
	 alphabetically in	the	 following	section,  and  then	 discussed.	 In
	 general, we  have attempted  to detect	 everything the	 ANSI  standard
	 considers dubious, and	 many things that  our experience suggests	are
	 important. If you find a type of error or warning we have not covered,
	 behavior which contradicts the ANSI requirements, or any  suggestions,
	 don't hesitate to contact us.

	 The format of all	the following messages is  as below. There are	two
	 types: 'Error' and 'Warning'. You will also be told which filename and
	 line number they refer to and, if inside a function, the name of  that
	 function. All messages are formatted like this:

		  [Error,Warning] <filename>(<N>): <message>
		  [Error,Warning] <filename>(<N>): <message> in <function name>

				Alphabetic Ordering of Error & Warning Reports.
	 
	 operator should be followed by an argument name
		  The # stringify operator must be followed by one of your	macro's
		  argument names.

	 
	 #elif after #else at line NNN
		  You have an #elif following a	 #else which is at line NNN.  #elif
		  may only occur following #if, #ifdef, #ifndef or #elif.

	 
	 #elif not within a conditional
		  You have a #elif not within  a conditional. #elif may only  occur
		  following #if, #ifdef, #ifndef or #elif.

	 
	 #else after #else at line NNN
		  You have an #else following a	 #else which is at line NNN.  #else
		  may only occur following a #if, #ifdef, #ifndef or #elif.

	 
	 #else not within a conditional
		  You have a #else not within  a conditional. #else may only  occur
		  following a #if, #ifdef, #ifndef or #elif.

	 
	 #endif not in conditional
		  You have a #endif not within a conditional. #endif may only occur
		  following a #if, #ifdef, #ifndef, #elif or #else.

	 
	 #error <string>
		  A	 #error	 directive	was	 encountered.  This	 is	 used  to  halt
		  compilation and print a message. CLint treats it the same way.

								   Page - 22
																CLINT V3.49

	 
	 #include: filename must be quoted
		  You must	enclose filenames  to be  included with	 either	 double
		  quotes or angle brackets like this:

			   #include "file.h"
		  or
			   #include <file.h>

	 
	 #line filename must be quoted
		  You must enclose the	filename in double	quotes. The syntax	for
		  #line is:

			   #line 10 "file.c"

	 
	 #line number expected
		  A number	is required	 for the  #line directive.	The syntax	for
		  #line is:

			   #line 10 "file.c"

	 
	 #line numbers must be >= 1
		  Only positive integers  greater than zero	 will be accepted.	The
		  syntax for #line is:

			   #line 10 "file.c"

	 
	 #line syntax
		  Meaningless #line statement. The syntax for #line is:

			   #line 10 "file.c"

	 
	 #undef: '<string>' is not a macro
		  You have tried to #undef a  name which is reserved or a  built-in
		  macro, such as __TIME__, __DATE__, __LINE__, or __FILE__.

	 
	 #ifdef with no argument
	 #ifndef with no argument
	 #undef with no argument
		  A single identifier must follow these directives.

	 
	 #ifdef argument starts with digit
	 #ifndef argument starts with digit
	 #undef argument starts with digit
		  Identifiers may only start with a-z, A-Z or underscore (_).



								   Page - 23
																CLINT V3.49

	 
	 <filename> is multiply included
		  The given file  has been	#included directly	or indirectly  more
		  than once. This is usually caused by header files including other
		  header files.	 Including a  file more	 than once	will slow  your
		  compiler	down,  and	possibly   lead	 to	 multiple	declaration
		  problems. You should protect files against multiple inclusion	 by
		  surrounding each #include directive that occurs in a header  file
		  with a test like this:

			   #ifndef __MYHEADER_H
			   #include "myheader.h"
			   #endif

		  Then in 'myheader.h' you do:

			   #ifndef __MYHEADER_H
			   #define __MYHEADER_H

			   ...... body of include file

			   #endif

		  This will prevent such problems completely. It is the method used
		  by most compiler vendors too.

	 
	 '<identifier>' undefined
		  CLint has seen a reference to the given identifier preceding	any
		  declaration of it. You must declare all identifiers before use.

	 
	 '<identifier>' has a different declaration in file(line)
		  When all files have  been parsed, CLint  checks that all	symbols
		  have consistent declarations in all project files.

	 
	 '<identifier>' has a duplicate definition in file(line)
		  When all files have been parsed, CLint checks that each symbol is
		  defined exactly once as required by the ANSI standard.

	 
	 '<identifier>' hides a library symbol in file(line)
		  When all files have  been parsed, CLint checks  to see if any	 of
		  your symbols has the same name as a symbol defined in any of	the
		  libraries you	 specified.	 Although it  is  legal to	redefine  a
		  library symbol, CLint considers it to	 be poor practice. You	can
		  suppress this warning with -w-lib.







								   Page - 24
																CLINT V3.49

	 
	 '<identifier>' assigned to but never used
		  When all files have been parsed, CLint checks for symbols defined
		  as global	 and assigned  to but  never referenced.  Such	symbols
		  waste space. When checking  part of a	 project (e.g. a  library),
		  you can suppress this message with -u.

	 
	 '<identifier>' assigned to but not used
		  It is wasteful and, possibly, a bug to have variables who's value
		  is never used. This may indicate	that in using #if  conditionals
		  that some logic is not correct.

	 
	 '<identifier>' declared but not used
		  This simply wastes space. You should remove the declaration.

	 
	 label '<identifier>' has same name as identifier
		  You have used	 a label which	 has the  same name	 as some  other
		  identifier. This is not an ANSI error but using the same name for
		  a variable and a label must be considered bad practice.

	 
	 '<identifier>' previously initilaized by file(line)
		  You have initialized	the given object  more than once.  Possibly
		  the name was miss-typed on the second occasion.

	 
	 '<identifier>' should be static
		  When all files have been parsed, CLint checks for symbols defined
		  as global but used in only the module in which they are  defined.
		  Such symbols	should	be	declared  static  to  avoid	 accidental
		  reference to them	 in later revisions.  When checking	 part of  a
		  project (e.g. a library), -u, or	disable it completely with	-w-
		  sgs.

	 
	 '<identifier>' is never used
		  When all files  have been parsed,	 CLint checks  for symbols	you
		  defined but did not use. Such	 symbols are wasting space in  your
		  program, and should be removed. When	checking part of a	project
		  (e.g. a library), you can suppress this message with -u.

	 
	 '<identifier>' is used but never defined
		  When all files  have been parsed,	 CLint checks  for symbols	you
		  used but did	not define,	 and could not	be found  in any  CLint
		  library you specified. Perhaps you forgot to specify a,  library,
		  or to	 define	 the symbol.  This	is exactly	equivalent	to	the
		  linker's message about undefined symbols. When checking part of a
		  project (e.g. a library), you can suppress this message with -u.



								   Page - 25
																CLINT V3.49

	 
	 '<identifier>' not an argument
		  You are  using the  old-style C  function declaration,  and  have
		  declared an argument not present in the parameter list.

		  The following example would report 'd' as not being an argument.

			   void f(a, b, c)
			   int a, b, d;
			   {
					.....
			   }

		  If you are using a pre-ANSI  compiler, you have our  condolences.
		  If not, switch to using prototypes. CLint can help by	 generating
		  prototypes for you.

	 
	 '<identifier>' possibly used before definition
		  You may be using a variable before having assigned a value to it.
		  If so, this is a serious error.

	 
	 '<identifier>' is not a label
		  You have used an identifier as  though it is a member name  (i.e.
		  after '.' or	'->' ) following  a known structure	 name, but	the
		  identifier is not a member of that structure.

	 
	 '<identifier>' is not a member
		  You have used an identifier as  though it is a member name  (i.e.
		  after '.' or	'->' ) following  a known structure	 name, but	the
		  identifier is not a member of that structure.

	 
	 '<library>' in old style CLint file format - ignored
		  The library format changed from 1.XX/2.XX to the current	version
		  of CLint.	 This  is because  the	extended checking  in  the	new
		  version needs more  information than	was recorded  in the  older
		  versions. When CLint	sees an	 old-style library	it issues  this
		  warning. You should rebuild the library using this version.

	 
	 ' ' advised after '<key word>'
		  These are issues	of style. If  you want	these warnings,	 enable
		  them with -wspc.

	 
	 ' ' advised after '<operator>'
		  These are issues	of style. If  you want	these warnings,	 enable
		  them with -wspc.




								   Page - 26
																CLINT V3.49

	 
	 '~' is not a binary operator
	 '!' is not a binary operator
		  These are the	 only two operators	 than can't be  used as  binary
		  operators.

	 
	 '.' must be followed by a member name
	 '->' must be followed by a member name
		  Whatever follows these operators is not a member name.

	 
	 '{' required to initialize aggregate
		  The ANSI standard requires that initialization of aggregates must
		  have the initializer list enclosed in braces.

	 
	 '/*' in comment
		  This may not be a problem, but the ANSI standard does not support
		  nested comments. If you  comment out a piece	of code as	follows
		  you will get the above message.

			   /* A=1 /* Temporary change */

		  CLint also supports the C++ style of comments, so you can prevent
		  this warning when it is intentional like this:

			   // A = 1 /* Temporary change */

		  Additionally, for compatibility with	Borland and other  compiler
		  vendors, you can instruct CLint  to support nested comments  with
		  the -C switch.

	 
	 -ve case with unsigned switch expr
		  You should  not use  negative case  values with  unsigned	 switch
		  expressions (even though they might  work). Possibly the type	 of
		  the expression should be re-examined.

	 
	 address of automatic returned
		  A deadly trap with functions	which return pointers is  returning
		  the address  of an  auto variable.  Since the	 pointer refers	 to
		  storage on  the stack	 which is  no longer  allocated, it	 really
		  points to junk. You must always fix this.

	 
	 arguments given to macro '<identifier>'
		  You have tried to	 call a macro with	arguments, but it does	not
		  take any. Only the parentheses are required.





								   Page - 27
																CLINT V3.49

	 
	 ambiguous operators should have parentheses
		  The operators concerned are '&&', '||'. '<<', '>>', '&', '|'	and
		  '^'. The precedence of these operators is often confused, and you
		  should use parentheses to make your intentions explicit.

	 
	 argument '<identifier>' unused
		  You have declared a function argument which is never used. If the
		  argument is  unused  intentionally,  you	can	 silence  CLint	 by
		  preceding the function definition with the line:

			   #pragma argsused

		  This is also effective with most modern compilers.

	 
	 'asm' or '_asm' not followed by operands
		  The syntax of asm is one of:

			   asm assembly
		  or
			   asm {
					assembly
					assembly
			   }
		  or
			   asm("assembly");

		  CLint saw	 something other  than one	of these.  Note that  CLint
		  makes no attempt to parse the assembly language text!

	 
	 assignment to 'const' object
		  A constant  object may  not be  modified. The	 value of  a  const
		  object is usually established at compile time, unless it is a non
		  const object passed  to a function  as a const  (to prevent  that
		  function from modifying it).

	 
	 at most one 'default' allowed
		  Extra defaults have no meaning. Check your switch braces.

	 
	 bad function storage class
		  Functions may not be: auto, register or typedef.

	 
	 badly punctuated parameter list in #define
		  When you define a macro with	parameters, the list of	 parameters
		  must begin  with	'('	 followed by  a	 comma	separated  list	 of
		  parameters, followed by ')'. The parameter list seen was not like
		  this.


								   Page - 28
																CLINT V3.49

	 
	 bad struct/union/enum name
		  You have tried to use a previously defined symbol as a tag.

	 
	 bad type for field
		  Bit fields may only be int, unsigned int or signed int.

	 
	 body is <N> lines long
		  This function	 is	 longer	 than the  current	warning	 level	for
		  function size.  The default  is 100  lines. You  may change  this
		  value by using the Checking Options | Style dialog box.

	 
	 both return and return of a value
		  This is a warning of potentially disastrous results, as  returned
		  values will be indeterminate!

	 
	 'break' not in loop or switch
		  You may only use break inside	 a loop or switch. Elsewhere it	 is
		  meaningless. This could possibly be caused by a bracing error.

	 
	 call of <identifier> with no prototype
		  You have called a function for which no prototype declaration has
		  been seen. You may either have failed to include a library header
		  file, or not provided prototype declarations in your local header
		  files. In this last case, CLint can help you generate prototypes.

	 
	 call of non-function
		  You have tried  to call something	 which is not  a function.	For
		  example:

			   void f()
			   {
						 ;
					   int i

					i();
			   }

		  This will probably be a typing  error, or you may have  misplaced
		  parentheses inside a complex expression.

	 
	 can't cast to function or array
	 can't cast to union or structure
		  You may not perform these types of cast as they are meaningless.





								   Page - 29
																CLINT V3.49

	 
	 can't find file '<filename>'
		  The include file specified could not be found. Check your include
		  paths, or spelling.

	 
	 can't find library '<filename>'
		  The library file specified could not be found. Check your include
		  paths, or spelling.

	 
	 can't have array of function
		  You can't have arrays of functions  - only arrays of pointers  to
		  functions.

	 
	 can't have both 'signed' and 'unsigned'
		  You have used both signed and unsigned in a declaration. Only one
		  of these may occur.

	 
	 can't take address of register
		  Register variables cannot have  addresses because, once  declared
		  as register, a variable  is assumed to be	 in a machine  register
		  (even if a  one is not  available for it,	 and memory storage	 is
		  used).

	 
	 case <N> unreachable
		  This occurs when you use a shorter integer switch expression than
		  the case values. (Incidentally it	 is considered bad practice	 to
		  use any  compiler options	 that allow	 you to	 set all  chars	 to
		  either signed	 or unsigned  as the  resulting code  will be  non-
		  portable and ambiguous to other programmers).

		  In any case, even if you do  use such a switch, your code	 should
		  not depend  on  this for	its	 correct operation.	 The  following
		  example provokes this warning.

			   char c = getch();

			   switch (c) {
			   case 'a': .........

			   case '128': ........
			   }

	 
	 'case' not in switch
		  A case has  been found which	is not inside  a switch	 statement.
		  This is possibly a bracing error.




								   Page - 30
																CLINT V3.49

	 
	 cast or sizeof not allowed in #if
	 cast or sizeof not allowed in #elif
		  The ANSI standard states that you can't use cast or sizeof in #if
		  or #elif. CLint allows  this with -G	because certain older  non-
		  ANSI compilers use it.

	 
	 character constant too long
		  Character	 constants	with  more	than  one  character  are  non-
		  portable, as the	ANSI standard states  that such	 values have  a
		  meaning determined solely by the writer of the compiler you use.

	 
	 code has no effect
		  The expression does nothing! Maybe something like this:

			   a == 1;

		  where you may have meant:

			   a = 1;

	 
	 conflicting pointer modifiers
		  You have used	 more than	one of	the type  modifiers near,  far,
		  huge, _ss, _cs, or  _handle. At most one	of these modifiers	may
		  occur adjacently.

	 
	 conflicting storage class specifiers
		  You may  not have	 more than	one	 storage class	specifier.	For
		  example, the following lines will not	 compile as they are  self-
		  contradictory:

			   static auto int i;
			   static extern char j;

	 
	 conflicting type specifier
		  You have used two or more types together like this:

			   char int x;

		  At most one type specifier may occur.










								   Page - 31
																CLINT V3.49

	 
	 conflicting use of external '<identifier>'
		  You have declared an external symbol outside any function. Later,
		  you declared the same name inside a function as extern, but  with
		  a different  declaration.	 One  or  other	 must  be  wrong!.	For
		  example:

			   int x;
			   void f(void)
			   {
					extern char x;
			   }

	 
	 constant assigned to 'enum %s'
	 constant compared with 'enum %s'
	 constant used with 'enum %s'
		  You have assigned, compared, or otherwise used a constant and	 an
		  enumerated type.	If this	 is intentional,  replace the  constant
		  with	an	enumerated	constant,  or  cast	 the  constant	to	the
		  enumerated type.

	 
	 constant 'switch' expression
		  This message warns  that in this	case the  switch expression	 is
		  constant and therefore, at most, one case will ever be  executed.
		  A likely cause of this problem could be the result of an expanded
		  macro or a typing error.

		  Incidentally, if you	ever think	a macro	 is causing	 unexpected
		  results, CLint can preprocess the source	for you into an	 editor
		  buffer so you can see exactly what happened.

	 
	 constant 'if' condition
	 constant 'while' condition
	 constant 'for' condition
	 constant 'do' condition
		  Constant conditions are assumed to be errors unless you have used
		  the following	 types of  statement, which	 are considered	 to	 be
		  common idiom:

			   while (1) {
					.....
			   }

			   do {
					.....
			   } while (1);

		  This message	may be	accompanied	 by complaints	about  constant
		  unsigned comparisons, which is the real cause of the problem.



								   Page - 32
																CLINT V3.49

	 
	 constant is long
		  You should add the suffix L to a constant number.	 Alternatively,
		  if the constant is  in the range 32768  through 65535, and  being
		  passed or assigned  to an unsigned  value, you should	 use the  U
		  suffix. You can  tell CLint  to support  32 bit  integers -3,	 in
		  which case these warnings won't occur.

	 
	 constant required
		  In several places,  such as array	 declarations and case	values,
		  constant expressions are required. For example:

			   int i[5];

			   int i[fred];

		  In the  second case  'fred' should  be a	macro with	a  constant
		  value. Also:

			   case fred: .....

		  will not	work, and  won't be  allowed by  your compiler  anyway.
		  There are	 other places  where this  may	occur, such	 as	 during
		  initialization.

	 
	 constant unsigned comparison
		  This is probably a bug, due  to assuming that the unsigned  value
		  is actually signed. For example:

			   unsigned int i;

			   if (i < 0) {
					.....
			   }

		  where the condition is always false, or the following, where	the
		  condition is always true:

			   unsigned int i;

			   if (i >= 0) {
					.....
			   }

	 
	 'continue' not in loop
		  A continue has been found which was not inside a loop. Check	for
		  a possible bracing error.





								   Page - 33
																CLINT V3.49

	 
	 conversion may lose significant digits
		  You have tried to assign a  value to a variable which is	greater
		  than that variable's possible range.

			   char c = 3;
			   int i = 256;

			   c = i;

		  In this case 'c' would end up with a value of zero!

		  By default, only assignments	of longs to	 ints, shorts or  chars
		  will be detected by CLint. But if you want to detect all possible
		  occurrences, such	 as	 in the	 above	example, use  -wsig+.  When
		  enabled, CLint it will also detect assignments of long double	 to
		  double or float, and double to  float. If you want to	 explicitly
		  make the conversion, use a cast.

	 
	 declaration syntax
		  CLint encountered	 a declaration	which  was impossible  to  make
		  sense of, such as:

			   int 0;

	 
	 'defined' must be followed by ident or (ident)
		  defined must	be	followed  by  an  identifier  or  parenthesized
		  identifier.

	 
	 'default' not in switch
		  A	 default  was  encountered	which  was	not	 inside	 a	 switch
		  statement. Check your code for possible bracing errors.

	 
	 degenerate unsigned comparison
		  This is probably a bug, due  to assuming that the unsigned  value
		  is actually signed or may have a negative value. For example:

			   unsigned int j;

			   while (j > 0) {
					....
			   }

		  this code actually means:

			   unsigned int j;

			   while (j != 0) {
					....
			   }

								   Page - 34
																CLINT V3.49


		  which is	much  clearer  and	easier	for	 other	programmers	 to
		  understand, and yourself when you refer to it later.

	 
	 different enum types in assignment
	 different enum types in conditional
	 different enum types in comparison
		  You have assigned one enumerated	type to a different	 enumerated
		  type. Did you really mean to do that? If so, use a cast.

	 
	 division by zero
		  An expression was found which would divide a constant by zero	 at
		  compile time.	 Possible causes  could be	a typing  error or	the
		  result of a macro expansion.

	 
	 does not have address
		  You have tried to	 take the address of  something which does	not
		  have one, such as a number. Check for macro expansions or	 typing
		  mistakes.

	 
	 duplicate case (NNNN)
		  The indicated case label has the same numeric value (NNNN) as	 an
		  earlier case. All case labels must be unique. This may arise from
		  macro expansion, or from undefined symbols.

	 
	 'else' not after 'if'
		  An else was found which did not immediately follow the end of	 an
		  if statement, like this:

			   if (fred)
					xxxx();
					yyyy();
			   else
					zzzz();

		  In the  above example	 you probably  forgot the  braces  required
		  between the if and the else, although the indentation makes  your
		  intention clear. We  recommend you  always use  braces after	if,
		  while, do and so on to avoid this problem.











								   Page - 35
																CLINT V3.49

	 
	 empty body of 'do' loop
	 empty body of 'while' loop
	 empty body of 'for' loop
	 empty else clause of 'if'
	 empty then clause of 'if'
		  Check for	 bracing  errors,  or  for	accidental	(or	 otherwise)
		  commenting out of the code. In  any case, the resulting code	may
		  be wasteful and inefficient. You can suppress these warnings with
		  -w-elb. CLint considers  an intentionally empty  loop body to	 be
		  denoted by a single ';'. If you prefer '{}', use -webb.

	 
	 end of file in macro call
		  A '\' (backslash) may have been found on the last line of a  file
		  while a macro call was in progress, or you may have a	 mismatched
		  parenthesis inside a macro call, in which case it will always	 be
		  a missing ')' which causes this problem.

	 
	 'enum <identifier>' has no enumerators
		  The  ANSI	 standard  requires	 that  each	 enum  declaration	has
		  enumerators. Unlike structures or unions	where you may define  a
		  tag for a	 structure or union	 which is later	 declared, this	 is
		  forbidden for enums.

	 
	 enumerator '<identifier>' not in 'enum <identifier>'
		  You have an enumerated constant from a different enumeration than
		  the one to which you are assigning. Here is a specific instance:

			   enum x {a, b};
			   enum y {c, d};

			   enum x i = c;

	 
	 enumerator list needed for 'enum <identifier>'
		  You have a partial  declaration of an	 enumeration for which	the
		  variable name was missing, possibly like this:

			   enum x;

		  where you probably meant:

			   enum x { a, b, ... };









								   Page - 36
																CLINT V3.49

	 
	 evaluation order undefined
		  In the  following	 example, it  is  undefined whether	 'a[2]'	 or
		  'a[3]' will  be assigned	to, as	it is  up to  compiler	writers
		  whether they	increment  'i'	before	or	after  calculating	the
		  address of 'a[i]'.

			   int a[5], i=2;

			   a[i]=++i;

		  Always break statement like this into two or more statements.

	 
	 expression syntax
		  CLint could not make sense of the expression.

	 
	 expression too complex
		  There are too	 may parentheses  or arguments	in the	expression.
		  CLint can't handle more than 40 (!) levels of parentheses.

	 
	 field too long
		  CLint assumes that an int takes  up 2 bytes (16 bits),  therefore
		  no field may be larger than  16. (Incidentally the ANSI  standard
		  warns that  the use  of bit  fields  can lead	 to all	 manner	 of
		  portability problems, as every  aspect of bit	 fields is left	 to
		  the compiler writer!). You can make CLint support 32 bit integers
		  and fields with -w-lnf or -3.

	 
	 float values not allowed in #if
	 float values not allowed in #elif
		  You may  not use	floating constants	or	expressions in	#if	 or
		  #elif.

	 
	 function '<identifier>' previously defined at file(line)
		  You have tried to declare the same function twice.

	 
	 function requires compound statement
		  Possibly a prototype has a missing  ';' and is therefore	assumed
		  to be a function	declaration, or you could  have missed out	the
		  first '{'.









								   Page - 37
																CLINT V3.49

	 
	 identifier expected
		  A declaration was	 expecting an  identifier to  declare. This	 is
		  most likely to be a typing error such as the following:

			   int ,j;

		  illegal 'void' type for '<identifier>'
		  You may not declare any objects as type void, like this:

			   void i;

		  perhaps you were intending to type one of the following:

			   void *i;
			   void i();

	 
	 illegal character '<char>' [<hex value>]
		  This character cannot be part of any C identifier or token.  Look
		  for a missing '"' before this character, as you probably meant it
		  to be part of a string.

	 
	 illegal conversion
		  You have	attempted  to  convert	between	 types	that  can't  be
		  converted - such as float to pointer.

	 
	 illegal conditional, ':' missing
		  This is probably a typing mistake like the following:

			   (x)? y, z;

		  where you intended to put a colon in place of the comma.

	 
	 illegal enum constant for '<identifier>'
		  You have tried  to specify the  value of	an enumerated  constant
		  with a non-constant expression, or  an expression which does	not
		  have an integral value.

	 
	 illegal enumeration '<identifier>'
		  You  have	 tried	to	use	 a	previously	defined	 symbol	 as	 an
		  enumerated constant.









								   Page - 38
																CLINT V3.49

	 
	 illegal indirection
		  You have tried to use an object that is not a pointer, either	 by
		  subscripting or direct use of the '*' operator, like this:

			   int i;
			   j = *i;

	 
	 illegal initialization
		  You have attempted to initialize a  variable outside the body	 of
		  any function with	 an expression. This  is not  possible as  code
		  would be needed, but which function could contain the code?

	 
	 illegal storage class
		  Outside the body	of any function	 you have tried	 to declare	 an
		  object auto or register.	Outside functions only extern,	static,
		  and typedef are permitted.

	 
	 illegal structure operation
		  The only operations allowed on structures are accessing a	 member
		  with '.' or  '->' and assigning  structures of the  same type	 to
		  each other.

	 
	 illegal type of operand
		  The bit operators '<<', '>>', '&', '|', and '|' can't be  applied
		  to operands of type float, double, or long double.

	 
	 illegal use of pointer
		  The only things  you can	do with	 pointers are  add or  subtract
		  integers to them, subtract  or compare two  pointers of the  same
		  type or indirect	them using '[]'	 or '*'. Perhaps  you may  have
		  added an 'int *' and a 'char *' or any other type of mismatch.

	 
	 include files nested too deep
		  CLint ran	 out  of  file handles	while  processing  a  #include.
		  Probably one of your files is recursively including itself.

	 
	 incompatible structure assignment
		  You have tried to assign a  structure of one type to a  different
		  one. In a structure assignment both must have the same type.








								   Page - 39
																CLINT V3.49

	 
	 initialization of auto aggregate
		  An 'aggregate'  is any  structure, union	or	array, that	 is:  a
		  collection of more primitive objects.	 All compilers use code	 to
		  initialize auto  objects. You	 can save  code and	 speed up  your
		  program by declaring	the object static  if you  don't intend  to
		  modify it.

	 
	 initializing undefined structure
		  You have	tried to  initialize a	structure  before it  has  been
		  declared.

	 
	 'interrupt' may only be used with 'void'
		  interrupt may only be used as 'void interrupt'.

	 
	 invalid macro name '<identifier>' in #define
		  The name you have tried to use for the macro is not legal.

	 
	 label '<identifier>' not used
		  The label is not used in your function. You should remove it.

	 
	 lvalue required
		  An 'lvalue'  is  an  expression  which  can  be  modified	 by	 an
		  assignment. You have tried to assign or modify something which is
		  not an 'lvalue'. For example:

			   0 = a;

	 
	 macro calls nested too deep
		  You may not nest macro calls more	 than 800 (!) deep. If you	get
		  this message you almost certainly have a recursive macro call.

	 
	 misplaced 'const'
		  You have uses a const incorrectly.

	 
	 misplaced 'long'
		  You have uses a long incorrectly, perhaps like this:

			   short long i;

	 
	 misplaced 'unsigned'
		  You have uses a unsigned incorrectly, perhaps like this:

			   signed unsigned int i;


								   Page - 40
																CLINT V3.49

	 
	 missing ')' after 'if' condition
	 missing ')' after 'while' condition
	 missing ')' after 'do' condition
	 missing '(' after 'if'
	 missing '(' after 'while'
	 missing '(' after 'switch'
	 missing ')' after '...'
	 missing ':'
	 missing label name after 'goto'
	 missing '}'
	 missing ';'
	 missing ')' in function call
	 missing operand
	 missing ')'
	 missing operator
	 missing ']'
	 missing ';' in 'for'
	 missing ')' in 'for'
		  Generally these will	be typing errors,  we have tried  to be	 as
		  helpful as possible in diagnosing them. You will normally find it
		  obvious what the problem is.

	 
	 missing macro name in #define
		  The syntax of #define is:

			   #define macro_name replacement
		  or
			   #define macro_name(args) replacement

	 
	 missing type in argument declaration
		  CLint was reading	 a function	 definition, and  found a  function
		  argument which had no type. Supply the missing type.

	 
	 mismatched filename quotes in #include
		  You have used both angle bracket and double quotes, like this:

			   #include "filename>
		  or
			   #include <filename"

	 
	 misuse of 'sizeof'
		  sizeof requires a	 following type declarator	or object name,	 or
		  you may have used it as a binary operator.







								   Page - 41
																CLINT V3.49

	 
	 mixing pointers to different 'char' types
		  You are using a  pointer to 'char *'	and a pointer to  'unsigned
		  char *' in the same expression. Although this will almost  always
		  work,	 you  may  need	 to	 consider  using  casts	 to	 make  your
		  intentions clear.

	 
	 multiple calling conventions
		  You have mixed __fortran, __pascal, or __fastcall in the function
		  declaration. At most one of these may be used.

	 
	 need struct/union name before '.'
		  You used	a '.'  or '->'	operator following	something which	 is
		  neither a 'struct/union' name or 'struct/union' pointer.	Usually
		  a typing mistake.

	 
	 need struct/union pointer before '->'
		  You used	a '.'  or '->'	operator following	something which	 is
		  neither a 'struct/union' name or 'struct/union' pointer.	Usually
		  a typing mistake.

	 
	 newline in string
	 newline in character constant
		  The ANSI standard requires  that strings and character  constants
		  are terminated prior to  the end of a	 line. You probably have  a
		  missing quote. If you were trying to get an end of line in single
		  quotes, use '\n'. To	continue strings, use  either '\' prior	 to
		  the end of  a line,  or terminate	 the current  string and  begin
		  again on the next line.

	 
	 no arguments to macro '<identifier>'
		  You have called a	 macro with only  parentheses, but it  requires
		  arguments.

	 
	 non-ANSI initializer bracing
		  The initializer expression is not braced in accordance with  ANSI
		  recommendations. You can disable this warning with -w-bbr.

	 
	 non-portable pointer conversion
		  This means that you have used a non pointer value expression in a
		  context where a pointer is required. For example:

			   char *p=0x123456;

		  In these cases cast the constant to the proper type. Although not
		  casting may appear to produce working	 code it is not	 guaranteed
		  and is exceedingly unlikely to be portable.

								   Page - 42
																CLINT V3.49

	 
	 null dimension
		  You are initializing an array where  a dimension (other than	the
		  first) is missing. For example:

			   char c[][] = {"ABC", "DEF", "GHI", "JKL"};

		  Remember, only the first subscript may be omitted, all subsequent
		  subscripts must be supplied.

	 
	 number syntax
		  You have specified a number which is illegal. For example:

			   09	9 is not an octal digit
			   1.e	Missing exponent
			   0x	Missing digits

	 
	 only 1 argument to macro '<identifier>'
		  You have	called the	macro with	one argument,  but it  requires
		  more.

	 
	 only N arguments to macro '<identifier>'
		  You have called the macro with N arguments, but it requires more.

	 
	 parameter name starts with a digit in #define
		  Parameters in #defines must be identifiers and therefore may	not
		  begin with a digit.

	 
	 pointer operands of '-' must have the same type
		  You may only subtract pointers of the same type.

	 
	 pointer assignment allows const violation
		  CLint takes  great  care to  check  that const  objects  are	not
		  assigned to. It has noticed your	program assigning to a	pointer
		  which does  not have	the const  modifier a  pointer to  a  const
		  object possibly like this:

			   const int i = 5;
			   int *ip = &i;

		  If this  assignment  was	allowed, you  could	 write	to	'i'	 by
		  dereferencing 'ip'.

	 
	 possible unintended assignment
		  CLint considers assignments  occurring in conditions	to be  poor
		  practice. You can disable this warning with -w-pua.


								   Page - 43
																CLINT V3.49

	 
	 printf: unknown conversion %<char>
	 printf: non-ANSI size specifier '<specifier>'
	 printf: more conversions than arguments
	 printf: found <N> unused arguments
	 printf: format string arg missing
	 printf: 'short' argument to %<specifier> - use %h<specifier>
	 printf: 'long' argument to %<specifier> - use %l<specifier>
	 printf: 'long double' argument to %<specifier> - use %L<specifier>
	 printf: '*' requires 'int' argument
	 printf: %<specifier> requires 'double' argument
	 printf: %<specifier> requires integral argument
	 printf: %s requires 'char *' argument
	 printf: %p requires pointer argument
	 printf: %n requires 'int *' argument
	 printf: %L<specifier> requires 'long double' argument
	 printf: %l<specifier> requires 'long' argument
	 printf: %h<specifier> requires 'short' argument
	 printf: %<specifier> is an illegal conversion
		  printf() and its	companion functions	 (sprintf() and	 fprintf())
		  can be one of the most  prolific sources of problems, mainly	due
		  to using incorrect '%' conversions.

	 
	 declaration of '<identifier>' differs from file(line)
		  Once declared you may not redeclare any object.

	 
	 redeclaration of tag '<identifier>'
		  Once declared you may not redeclare any object.

	 
	 redefinition of '<macro>' not identical
		  While the ANSI standard allows you to define macros as many times
		  as required, each definition	must be functionally equivalent	 to
		  all the  others.	CLint has  seen	 a redefinition	 which	is	not
		  equivalent.

	 
	 'register' used
		  Modern compilers allocate registers very efficiently. You	 should
		  not use register unless you are very familiar with the compiler's
		  code generation strategy. You can	 disable this warning with	-w-
		  reg.

	 
	 runtime division by zero
		  When you run this program, this expression will attempt to divide
		  by zero. Did you really mean that?






								   Page - 44
																CLINT V3.49

	 
	 statement after 'if' should have '{'
	 statement after 'else' should have '{'
	 statement after 'do' should have '{'
	 statement after 'while' should have '{'
	 statement after 'for' should have '{'
		  Mainly a matter of style. However,  always using the brace  pairs
		  (even when not necessary) can avoid  errors. You can control	the
		  reporting of these specifically with the Checking Options | Style
		  dialog box.

	 
	 static '<identifier>' assigned to but not used
		  Please refer to 'identifier assigned/declared...'.

	 
	 string constants not allowed in #if
	 string constants not allowed in #elif
		  You can't use string constants in #if or #elif.

	 
	 static '<identifier>' declared but not used
		  This wastes space in your program. As the object is static, it is
		  not visible  outside	the	 file containing  the  definition,	and
		  therefore can't ever be referenced.

	 
	 'struct %s' used before definition
	 'union %s' used before definition
		  You have tried to	 declare the structure	or union object	 before
		  the structure or union itself has been declared.

	 
	 struct '<identifier>' redeclared
		  Once declared you may not redeclare any object.

	 
	 struct/union passed by value
		  Mainly a matter of efficiency, as	 this type of code is slow	and
		  could unnecessarily use a lot of stack space. Also, some	earlier
		  compilers failed	to	handle	recursive  functions  which	 return
		  structure values. In any case, it is never necessary to use  this
		  as you can always achieve the same effect using pointers.

	 
	 struct/union value returned
		  Mainly a matter of efficiency, as	 this type of code is slow	and
		  could unnecessarily use a lot of stack space. Also, some	earlier
		  compilers failed	to	handle	recursive  functions  which	 return
		  structure values. In any case, it is never necessary to use  this
		  as you can always achieve the same effect using pointers.




								   Page - 45
																CLINT V3.49

	 
	 suspicious pointer conversion
		  You have compared	 or otherwise  used pointers  to two  different
		  types.

	 
	 syntax error
		  It was too hard for CLint to provide a specific diagnostic.

	 
	 syntax error in 'asm'
		  The syntax of asm is one of:

			   asm assembly

			   asm {
					assembly
					assembly
			   }

			   asm("assembly");

	 
	 text after #include filename
		  '#include' must be only followed by a single quoted filename.

	 
	 text after #else
	 text after #endif
		  #else and #endif	may not be	followed by anything  other than  a
		  comment.

	 
	 text after #ifdef argument
	 text after #ifndef argument
		  #ifdef and #ifndef must be followed by a single identifier.

	 
	 too few arguments in function call
		  There are fewer arguments in the call of the pointer to  function
		  than declared in the prototype. Supply the missing arguments.

	 
	 too few arguments in call of '<function>'
		  There are	 fewer	arguments in  the  call of	the	 function  than
		  declared	in	the	 function's   prototype.  Supply  the   missing
		  arguments.

	 
	 too few arguments
		  There are fewer arguments in the call of the pointed to  function
		  than declared	 in the	 function pointer's  prototype. Supply  the
		  missing arguments.


								   Page - 46
																CLINT V3.49

	 
	 too many '}'s
		  Almost always a typing error. Check your braces.

	 
	 too many arguments in call of '<function>'
		  There are	 more  arguments  in the  call	of	the	 function  than
		  declared	in	the	 function's   prototype.  Remove  the   surplus
		  arguments.

	 
	 too many arguments in function call
		  There are more arguments in the  call of the pointer to  function
		  than declared in the prototype. Remove the surplus arguments.

	 
	 too many (N) arguments to macro '<identifier>'
		  You have	supplied  more arguments  in  the macro	 call  than	 it
		  requires.

	 
	 too many arguments
		  There are more arguments in the  call of the pointed to  function
		  than declared	 in the	 function pointer's  prototype. Remove  the
		  surplus arguments.

	 
	 too many dimensions
		  You have declared an	array with more	 dimensions than CLint	can
		  handle (18).

	 
	 too many initializers for '<identifier>'
		  You declared an  array or struct	but supplied more  initializers
		  than elements or members.

	 
	 too many storage class specifiers
		  You have used more than one  of typedef, register, auto,	extern,
		  or static in a declaration. At most one of these may occur.

	 
	 too many structure initializers
		  In  a	  multiply	 braced	 initialization	  you	supplied   more
		  initializers in  an inner-braced	pair than  there are  structure
		  members.









								   Page - 47
																CLINT V3.49

	 
	 trigraph '??='
	 trigraph '??/'
	 trigraph '??''
	 trigraph '??('
	 trigraph '??)'
	 trigraph '??!'
	 trigraph '??<'
	 trigraph '??>'
	 trigraph '??-'
		  If you get this you may  be unaware that the above sequences	are
		  actually reserved by the ANSI standard.  We only mention this	 as
		  some compilers may act on them. To find out more about  trigraphs
		  read the second edition of "The White Book". (K&R).

	 
	 typedefed a pointer type as '<identifier>'
		  Issues of	 style	and	 clarity. You  can	control	 these	reports
		  specifically with -wtyp.

	 
	 typedefed <type> as '<identifier>', use <identifier>
		  Issues of	 style	and	 clarity. You  can	control	 these	reports
		  specifically with -wtys.

	 
	 typedefed enum as '<identifier>'
		  Issues of	 style	and	 clarity. You  can	control	 these	reports
		  specifically with -wtye.

	 
	 questionable typedef as '<identifier>'
		  Issues of	 style	and	 clarity. You  can	control	 these	reports
		  specifically with -wtyg.

	 
	 type too complex
		  There are more than 18 type modifiers (pointer, array,  function)
		  in the type you are declaring. This exceeds CLint's limits.

	 
	 type mismatch in argument '<identifier>'
		  You have called a function with  an argument type different  from
		  that declared in the function's prototype.











								   Page - 48
																CLINT V3.49

	 
	 type not needed in old style definition
		  Old style function definitions look like this:

			   void f(a, b)
			   int a, b;
			   {

		  but CLint has seen a declaration looking like this:

			   void f(a, int b)

		  which is as far as it has read. Because the first argument had no
		  type, it assumes that it is reading an old style definition,	but
		  then it saw the type. Old style definitions are not  recommended.
		  Perhaps you omitted the type on the first argument?

	 
	 undeclared type name '<identifier>'
		  This message will occur if you write a line as follows where	you
		  had intended to use a 'typedef' for 'thing'.

			   thing x;

	 
	 undefined label '<identifier>'
		  CLint got to the	end of the function	 and found that you	 hadn't
		  actually declared this label!

	 
	 unexpected ']'
	 unexpected ')'
		  Typing error? Did you mean that?

	 
	 unexpected end of file
		  You have a missing '}' at the end of the file.

	 
	 unknown directive #<string>
		  This is not a known preprocessor '#directive'.

	 
	 unknown object size
		  You have mentioned  an object	 who's size  is not  known (but  is
		  required at this point) because you have not yet declared it. You
		  may need to rearrange your declarations to ensure the declaration
		  precedes this use.







								   Page - 49
																CLINT V3.49

	 
	 unreachable code
		  This statement will never be executed.  You can silence CLint	 by
		  preceding the line with:

			   #pragma notreached

		  which is not	- unfortunately	 - effective  with most	 compilers.
		  When the unreachable code is a break, -wnub will silence CLint.

	 
	 unterminated parameter list in #define
		  You are defining a macro which  takes arguments, but the	closing
		  parenthesis ')' was not seen before the end of the line.

	 
	 unterminated comment
		  You have a '/*' which is not closed before the end of the file.

	 
	 unterminated #conditional
		  You have a conditional '#directive' which remains unterminated by
		  a #endif at the end of the file.

	 
	 value assigned to 'enum <identifier>' not an enumeration
		  You have assigned a value (which	is not an enumerated  constant)
		  to an enumeration. Like this:

			   enum x i = 5;

	 
	 value should be returned
		  This function declares that  it will return a	 value, but at	the
		  end of the  function there is	 no return statement  to give  this
		  value.

	 
	 void functions can't return a value
		  You have attempted to return a value from a function declared	 as
		  void, that is a function declared as not returning a result.

	 
	 'while' must follow 'do' body
		  The syntax of do is:

			   do {
					statement
			   } while (condition);

		  No while was found after the '}'.




								   Page - 50
																CLINT V3.49

	 
	 zero length row in '<identifier>'
		  You declared an array with an explicit zero subscript, like this:

			   char c[0];

		  which would allocate zero memory if it were legal.


							  Discussion Sections
							  

	 We believe	 that C	 programs should  be understandable,  maintainable,
	 portable, and above all efficient. CLint was designed to assist in the
	 achievement of these goals. CLint	produces several reports which	can
	 help you write code  meeting these objectives.	 We discuss several	 of
	 the reports detailed in the alphabetic listing.


	 Efficiency
	 

	 
	 auto aggregate initialization
		  An 'aggregate'  is  any  structure,  union  or  array	 -	i.e.  a
		  collection of more primitive objects.	 All compilers use code	 to
		  initialize 'auto'	 objects.  Where these	objects	 are  primitive
		  types, the code is equivalent to assignment.

		  Where the object is a 'struct', 'union', or array, the  compilers
		  generate a static unnamed object of the same type and	 initialize
		  that - and then generate code to copy this hidden object to  your
		  object.

		  You can save	code and  speed up	your program  by declaring	the
		  object  'static',	 which	avoids	 the  copy	operation  as	the
		  initialization is performed once at compile time. This will  only
		  work if you never	 modify the object! If	you do, then  carefully
		  examine the logic of	your code - it	is almost never	 necessary,
		  and often confusing. A common case is:

			   void f()
			   {
					char string[] = "a string ....";
			   }

		  where if	'string' is not	 modified it should be static. You	can
		  disable this warning with -w-iag.







								   Page - 51
																CLINT V3.49

	 
	 struct/union passed by value
	 struct/union value returned
		  Both these  cases	 cause	a significant  amount  of  code	 to	 be
		  generated, and stack space  usage equivalent to  the size of	the
		  object. When	you pass  a structure  value, the  entire value	 is
		  pushed on the stack. When you	 return a structure, space for	the
		  return value is reserved on the stack, and in normal cases copied
		  from the stack to the destination, for example:

			   struct x {
					......
			   };

			   struct x f(void)
			   {
					struct x y;

					......
					return y;
			   }

		  This typical	code  skeleton	copies the	value  of  'y'	to	the
		  reserved space on the stack, and (assuming you use the result	 by
		  assignment) copies that  value to the	 destination! If you  don't
		  want these warnings, use			-w-stv.

	 
	 '<name>' not used
	 static '<name>' not used
	 '<name>' assigned to but not used
	 static '<name>' assigned to but not used
	 argument '<name>' not used
		  These all indicate problems with the	program logic - often  they
		  are  a  result  of  code	changes	 which	cause  previously  used
		  variables to become unused. Sometimes they indicate a real bug  -
		  you assigned a  value for a  reason, but then	 that value is	not
		  used. However they  arise, they should  be cleared -	if only	 to
		  reduce the size of the program.

		  In the case of "argument 'x' not used" this may be intentional  -
		  you can silence CLint by placing:

			   #pragma argsused

		  ahead of the function declaration. This clearly announces what is
		  going on to any people reading the code too.








								   Page - 52
																CLINT V3.49

	 
	 label '<name>' unused
		  Most compilers assume when they see  a label that control may	 be
		  transferred to  a	 label by  'goto',	and therefore  discard	the
		  values of any registers they may be remembering. A label that	 is
		  not used will usually not be detected as such, and will cause the
		  same	action.	 This  can	result	in	larger	slower	code  being
		  generated immediately following such a label.



								  Coding Style
								  

	 statement after 'for' should have '{'
	 statement after 'while' should have '{'
	 statement after 'do' should have '{'
	 statement after 'if' should have '{'
	 statement after 'else' should have '{'
		  Any of these not followed by a key word, as for example:

			   if (x > 5)
					++i;

		  should be fully braced like this:

			   if (x < 5) {
					++i;
			   }

		  If you agree with	 us, any of	 these may be  enabled by -wfbr,  -
		  wwbr, -wibr, -webr.

	 
	 ' ' advised after '='
	 ' ' advised after ','
	 ' ' advised after ';'
	 ' ' advised after ':'
		  Some spacing	styles	are	 hard to  read.	 We	 believe  that	all
		  operators should have white  space either side,  but this is	too
		  draconian, so we object to things like:

			   a=1,b=2;f(3,a);

		  which will provoke 5 complaints. It should be written as:

			   a = 1, b = 2; f(3, a);

		  If you want this checking, enable it with -wspc.






								   Page - 53
																CLINT V3.49

	 
	 ' ' advised after '<key word>'
		  We believe  that	many  people  reading  code	 use  visual  clues
		  extensively. One of the clues often  used is function calls  have
		  the form 'name(...)'.	 Some programmers have	a habit of	writing
		  language clauses as though they were function calls, like:

			   if(j == 0)

		  At first glance, this is enough like a function call to at  least
		  arrest the eye. This is also enabled by -wspc.



								Use of Typedef.
								

	 typedefed enum as '<name'>
	 typedefed struct/union as '<name>' - use initial capital
	 typedefed a pointer as '<name>'
	 typedefed 'unsigned char' as '<name>' - use lower case
		  We consider typedef misuse  to be one of	the major crimes  often
		  committed with  C. Some  extremely obscure  code can	occur  when
		  typedefs are used, and  if the declaration is	 in a header  file,
		  considerable time may be needed to discover what the code	 really
		  means - for example, given:

			   #include "junk.h"

			   void f()
			   {
					garbage x;

					........
			   }

		  what is 'x'? We propose some rules for the use of typedef to make
		  it at least possible to get some hints:

			1) When typedefing unions  or structs, always have	an initial
			capital letter in the name - or capitalize the entire name.

			2) Never typedef an enumeration - use  'enum thing x' instead,
			which clearly announces to the reader what is going on.

			3) Never typedef pointer  types - the  presence of the	'*' in
			the declaration is a valuable clue to understanding.

			4) When typedefing a  primitive type, always use  a lower case
			name, the reader can then be assured that  all lower case type
			names are really simple objects like 'int'.

		  These objections can be  enabled if you agree	 with us: -wtye,  -
		  wtys, -wtyp, -wtyb.

								   Page - 54
																CLINT V3.49

							Potentially Serious Bugs
							

	 There are many potential  bugs which CLint warns  about. Some of  them
	 can lead to extremely obscure problems. The most important are:

	 '<name>' possibly used before definition
		  You will recall that 'auto' and 'register' objects which are	not
		  the arguments of functions have  undefined values (for this  read
		  'whatever was on the stack before the call'). If you refer to the
		  value of such an object before a value is assigned to it you	are
		  guaranteed  to   get	junk.	Sometimes	the	 message   may	 be
		  inappropriate, as in:

			   struct x {
					struct x *next;
					......
			   } *head, *p, *q;

			   for (p = head; p; p = q) {
			-->
					q = p->next;
			   }

		  This provokes "'q' possibly used  before definition" at the  line
		  marked with  the arrow  - but	 we can	 see that  'q' is  in  fact
		  assigned before it's value is required  in the 'for'. Almost  any
		  other occurrence of this bug is a genuine error, and it is  worth
		  clearing this	 non-error occasion	 by	 initializing 'q'  to  NULL
		  anyway.

	 
	 "evaluation order undefined"
		  The standard clearly states that in a statement like:

			   a[i] = ++i;

		  that the	meaning	 of	 the statement	is	undefined  because	the
		  compiler writer is free to evaluate the expression components	 in
		  any order that is convenient - to the compiler writer!

		  Similar problems arise with any operator which has a side effect,
		  and CLint takes some care to	check them all. It is also	careful
		  that when	 operators whose  evaluation order	is defined	by	the
		  standard	are	 used,	('||',	 '&&',	'?',  ',')	that   improper
		  complaints  don't  occur.  A  particular  trap  with   optimizing
		  compilers is that the order  of evaluation of function  arguments
		  is undefined, so:

			   f(a[i], i++);

		  provokes this complaint too.




								   Page - 55
																CLINT V3.49

	 
	 ambiguous operators need parentheses
		  This occurs if any of the operators '||', '&&', '|', '&', or	'^'
		  are adjacent and different  in an expression without	parentheses
		  round one of them. For example:

			   if (flag && test1 || test2) ....

		  is true if  '(flag && test)' or 'test2'. What might be meant is:

			   if (flag && (test1 || test2)) ....

		  This can cause no	 end of grief, because	most people forget	the
		  relative precedences of these operators.

	 
	 printf: ....
	 scanf: ....
		  There	 are  a	 series	 of	 possible  errors  that	 can  be  given
		  concerning  the  use	of	'printf()',	 'fprintf()',  'sprintf()',
		  'scanf()', 'fscanf()', and 'sscanf()'. All calls to these library
		  functions are	 tested	 argument  by  argument	 against  the  ANSI
		  standard for the	supported conversions. Each	 '%' conversion	 is
		  checked against the corresponding argument  to be of the	correct
		  type. This can catch	a surprising number	 of bugs in	 apparently
		  working programs.

	 
	 unreachable code
		  This may occur due to any number of logical problems. It can also
		  be caused	 by	 providing a  'return  x' which	 Borland  compilers
		  sometimes incorrectly	 insists on	 at the	 end of	 functions.	 In
		  cases where you  know the statement  concerned can't be  reached,
		  precede the offending statement with:

			   #pragma notreached

		  which	 will  silence	 CLint,	 but   not	unfortunately	Borland
		  compilers.

	 
	 value should be returned
	 both return and return of a value
		  These are often a hold-over from pre-ANSI C code. You would often
		  write:

			   func()
			   {
					.....
			   }





								   Page - 56
																CLINT V3.49

		  where under ANSI you should write:

			   void func(void)
			   {
					.....
			   }

		  The second case  is more	worthy of  attention. A	 number of	so-
		  called working programs  exhibit this	 one -	it can	be a  nasty
		  trap. Often, the program will work - under a particular  compiler
		  - because	 the value	in	the return	register  left by  a  prior
		  expression just happened	to be  the value  required! You	 should
		  always fix this.










































								   Page - 57
