From buck.hodges@ustra.mail.abb.com Fri Apr 30 12:37:45 1999
MIME-Version: 1.0
From: buck.hodges@ustra.mail.abb.com
X-Lotus-FromDomain: ABB_USTRA@ABB_US01
To: lclint-bug@salsa.lcs.mit.edu
Date: Fri, 30 Apr 1999 12:41:23 -0400
Subject: bug reported by lclint
Mime-Version: 1.0
Content-type: text/plain; charset=us-ascii
Content-Disposition: inline


I'm using lclint with gcc that comes with Cygwin B20.1 that I downloaded
from Cygnus
(http://sourceware.cygnus.com/cygwin).  Details below.

Buck Hodges.

C:\tmp>cat C:\tmp\.lclintrc
-weak
-enumint
-ID:\util\cygnus\cygwin-b20\H-i586-cygwin32\i586-cygwin32\include
-ID:\util\cygnus\cygwin-b20\H-i586-cygwin32\i586-cygwin32\include\mingw32


C:\tmp>lclint enumtest.c
LCLint 2.4b --- 18 Apr 98

D:\util\cygnus\cygwin-b20\H-i586-cygwin32\i586-cygwin32\include\sys/reent.h
:172:

    30: *** Internal Bug at D:\evs\lclint-2.4a\src\ctbase.i:2083:
    ctbase_newBaseExpFcn: fixing expfunction: bad complex type: <expf:
    ? *> [errno: 2]
*** Last code point: D:\evs\lclint-2.4a\src\llmain.c:977
*** Previous code point: D:\evs\lclint-2.4a\src\llmain.c:755
system error: : No such file or directory
     *** Please report bug to lclint-bug@sds.lcs.mit.edu ***
       (attempting to continue, results may be incorrect)
enumtest.c: (in function doSomething)
enumtest.c:12:9: Return value type int does not match declared type
ErrorCode:
                    6
  Types are incompatible. (-type will suppress message)
enumtest.c: (in function main)
enumtest.c:20:25: Format argument 1 to printf (%d) expects int gets enum {
                     ENUM1, ENUM2 }: ENUM1
  Type of parameter is not consistent with corresponding code in format
string.
  (-formattype will suppress message)
   enumtest.c:20:19: Corresponding format code
enumtest.c:21:25: Format argument 1 to printf (%d) expects int gets enum {
                     ENUM1, ENUM2 }: ENUM2
   enumtest.c:21:19: Corresponding format code
D:\util\cygnus\cygwin-b20\H-i586-cygwin32\i586-cygwin32\include\mingw32\std
arg.h
: (in macro va_start)
D:\util\cygnus\cygwin-b20\H-i586-cygwin32\i586-cygwin32\include\mingw32\std
arg.h

    :81:47: Cast to abstract type va_list: (va_list)(&pN)
  An abstraction barrier is broken. If necessary, use /*@access <type>@*/
to
  allow access to an abstract type. (-abstract will suppress message)
D:\util\cygnus\cygwin-b20\H-i586-cygwin32\i586-cygwin32\include\mingw32\std
arg.h

    :81:37: Left operand of + is abstract type (va_list):
    (va_list)(&pN) + __va_argsiz(pN)

Finished LCLint checking --- 5 code errors found

********************* enumtest.c ***********************
#include <stdio.h>

typedef enum
{
     ENUM1,
     ENUM2
} ErrorCode;

ErrorCode doSomething()
{
     return 6;
}

int main(int argc, char *argv[])
{
     ErrorCode foo;

     foo = ENUM1;
     printf("Enum1 = %d\n", ENUM1);
     printf("Enum2 = %d\n", ENUM2);

     return 0;
}

********************* end enumtest.c *********************




