[splint-discuss] checking Oracle Pro*C files

Ludolf Holzheid lholzheid at bihl-wiedemann.de
Tue Jan 23 15:13:59 PST 2007


On Tue, 2007-01-23 16:26:35 -0600, Phil Lawrence wrote:
> [..]
> 
> dcv_ex_account_table.pc:56:7: Parse Error. (For help on parse errors, see
>             splint -help parseerrors.)
> *** Cannot continue.
> 
> Here's the relevant section from the preprocessed source:
>   420  long dcv_openCursorExAccountTable(char *i_db_name, char *
> i_accountNumber)
>   421  {
>   422    strcpy(db_name, i_db_name);
>   423
>   424  /* EXEC SQL BEGIN DECLARE SECTION; */
>   425  #line 54 "dcv_ex_account_table.pc"
>   426
>   427    /* VARCHAR sqli_inputAccount[15]; */
>   428  struct { unsigned short len; unsigned char arr[15]; } 
>   sqli_inputAccount;
>   429  #line 55 "dcv_ex_account_table.pc"
>   430
>   431  /* EXEC SQL END DECLARE SECTION; */
>   432  #line 56 "dcv_ex_account_table.pc"
>   433
>   434
>   435  memcpy(sqli_inputAccount.arr,i_accountNumber,15);
>   436  sqli_inputAccount.len = 15;
>   437
> 
> What is causing the parse error?  It's not the 'EXEC SQL...' stuff,
> because that's now in a comment, right?  Is it the memcpy line?

Hello Phil,

splint chokes on line 428 of the preprocessor output, or line 56 (54
+2) of dcv_ex_account_table.pc, respectively. The problem with this
line is, this is a declaration following a statement. This is not
allowed in ANSI C89/ISO C90 and splint's parser is not able to parse
this.

There have been wishes to update the parser to support C99, but
nobody volunteered.

Maybe you could change the "EXEC SQL BEGIN DECLARE SECTION" to a
opening brace (and insert a closing brace somewhere below).  I'm
afraid checking your "Oracle Pro*C" files is going to get tricky.

Ludolf

-- 

---------------------------------------------------------------
Ludolf Holzheid             Tel:    +49 621 339960
Bihl+Wiedemann GmbH         Fax:    +49 621 3392239
Floßwörthstraße 41          e-mail: lholzheid at bihl-wiedemann.de
D-68199 Mannheim, Germany
---------------------------------------------------------------



More information about the splint-discuss mailing list