Thread: splint usage problems

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    147

    splint usage problems

    I'm new to splint use. I'm having problems using it with programs that include windows.h or process.h
    is there any option I missing or any thing I am missing? I'm using this command line:

    Code:
    splint -Ic:\codeblocks\MinGW\include -Ic:\CodeBlocks\MinGW\lib\gcc\mingw32\3.4.5\include z:\tmp_keops\*.c
    this is the output:
    Code:
    Splint 3.0.1.6 --- 11 Feb 2002
    
       In file included from c:\codeblocks\MinGW\include\windef.h(253),
                     from c:\codeblocks\MinGW\include\windows.h(48),
                     from z:\tmp_keops\defs.h(12),
                     from z:\tmp_keops\protos.h(10),
                     from z:\tmp_keops\bench.c(11)
    c:\codeblocks\MinGW\include\winnt.h(2352,34): #error "undefined processor type"
       In file included from z:\tmp_keops\bench.c(12)
    z:\tmp_keops\debug.h(19,21): invalid character in macro parameter name
    z:\tmp_keops\debug.h(19,21): Parameter list for #define is not parseable
    z:\tmp_keops\debug.h(48,29): invalid character in macro parameter name
    z:\tmp_keops\debug.h(48,29): Parameter list for #define is not parseable
    Preprocessing error for file: z:\tmp_keops\bench.c
    *** Cannot continue.
    any helo will be wellcome.
    thx

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > c:\codeblocks\MinGW\include\winnt.h(2352,34): #error "undefined processor type"
    Look in winnt.h at that line, and you'll see it's at the end of an
    #if
    #elsif
    #else
    #error
    #endif
    kind of construct.
    Try adding something like
    -DARCH=X86
    or whatever would match one of the choices in winnt.h

    As for debug.h, you'll have to post line 19 +/- a few lines for context.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    I'm not sure if you might find something here:
    http://www.splint.org/faq.html

    http://www.splint.org/faq.html#quest15 sounded close.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  4. #4
    Registered User
    Join Date
    Feb 2008
    Posts
    147
    Quote Originally Posted by Salem View Post
    >
    Try adding something like
    -DARCH=X86
    or whatever would match one of the choices in winnt.h
    I will try and tell about results

    Quote Originally Posted by Salem View Post
    >
    As for debug.h, you'll have to post line 19 +/- a few lines for context.
    My debug is like this:
    Code:
    #ifndef _DEBUG
    #define Print(x,...)  -- this is the 19th line ----
    #else
    void Print ( char *tag, char *formato, ... );
    #endif

  5. #5
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Quote Originally Posted by Kempelen View Post
    My debug is like this:
    Code:
    #ifndef _DEBUG
    #define Print(x,...)  -- this is the 19th line ----
    #else
    void Print ( char *tag, char *formato, ... );
    #endif
    Well those would be illegal characters there in magenta.

    But their FAQ did mention that they haven't fully implemented C99 features (such as variadic macros).
    http://c-faq.com/cpp/varargs.html
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  6. #6
    Registered User
    Join Date
    Feb 2008
    Posts
    147
    OK, as it is not possible to use splint wit a windows programm, and as I use veriadic macros, I thinking on switching to PC-Lint. Does anyone has an lnt file to run with MinGW?
    In the web page it says nothing about minwg, and the price is very expensive.
    Does anyone has use PC-lint with Mingw?
    Last edited by Kempelen; 05-05-2008 at 06:35 AM.

  7. #7
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    Quote Originally Posted by Kempelen View Post
    Does anyone has an lnt file to run with MinGW?
    http://www.gimpel.com/html/ptch80.htm#colnt (co-gcc.lnt?)

    Quote Originally Posted by Kempelen View Post
    Does anyone has use PC-lint with Mingw?
    It's on my to-do list.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. No clue how to make a code to solve problems!
    By ctnzn in forum C Programming
    Replies: 8
    Last Post: 10-16-2008, 02:59 AM
  2. Memory usage and memory leaks
    By vsanandan in forum C Programming
    Replies: 1
    Last Post: 05-03-2008, 05:45 AM
  3. Splint
    By tretton in forum C Programming
    Replies: 24
    Last Post: 02-05-2006, 09:30 PM
  4. Calculating CPU Usage
    By vitaliy in forum Linux Programming
    Replies: 3
    Last Post: 08-21-2005, 09:38 AM
  5. Win2K Limiting CPU Usage?
    By drdroid in forum Tech Board
    Replies: 4
    Last Post: 03-31-2004, 02:08 PM