[splint-discuss] checking Oracle Pro*C files

Phil Lawrence prlawrence at gmail.com
Tue Jan 23 14:26:35 PST 2007


On 1/22/07, Michael Wojcik <Michael.Wojcik at microfocus.com> wrote:

> You really don't want to preprocess and then use Splint.  That will
> cripple a number of Splint features (code annotations, recognition of
> standard headers, etc).  Instead, suppress the EXEC SQL statements when
> Splint is running, as I described above.

OK, I understand how I lose functionality by running against the
preprocessed source.

Still, help me understand this:
I preprocess the file, which means (AFAIK) that all the super Oracle
syntax is turned into valid c.  So here's a parse error from splint on
my preprocessed file:

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?

Thanks,
Phil


More information about the splint-discuss mailing list