Re: Error during Pro*C compilation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rachit,

Okay, obviously, from what I can see, there is an exit condition (ocurrance of some sql error) which is supposed to end some iteration (thus the break).

What I cannot tell, or am not sure about:

It looks like the there is no iterating loop, which the break belongs too, at least not in this source file. On the other hand, from what I know, break is only available within looping control structures. Since I don't know Pro*C and which non standard options it provides, I can only guess that the statement is meant to break out of the function thus avoiding the return value true. So maybe, a simple modification from:
if (sqlca.sqlcode == 1403) break;
into
if (sqlca.sqlcode == 1403) return FALSE;

might fix the code and do what is meant to do. But, it's pretty hard to tell, without any surrounding code. So, I guess, you need to dig into the code a little and analyze it to find out, if the break at this position actually resembles a return FALSE. In the Pro*C source you attached, I cannot see any specific error checking after the actual insertion. If the if/break statement was created during conversion, it might just be an error in the conversion process?


Regards

-Sven

Rachit.Verma@xxxxxxxxxxxx wrote:
Sven,

Thanks a lot of the piece of advice. That helped to solve our problem and
we were successfully able to compile the sample file provided by Oracle.

Now, while compiling our application related code, we are successfully able
to convert .pc to .c. While compiling .c file, we are getting the following
error:

Code.c: In function `ProcessSelectList':
Code.c:2240: warning: passing arg 2 of `sqlprc' from incompatible pointer
type
Code.c:2240: warning: passing arg 3 of `sqlprc' from incompatible pointer
type
Code.c: In function `WriteResultToTable':
Code.c:3806: error: break statement not within loop or switch
Code.c: In function `strtok2':
Code.c:4462: warning: comparison of distinct pointer types lacks a cast

When I saw my Pro*C code, I could not find an equivalent 'break' statement.
Attached below is the Pro*C section of the code where this error is
generated:

(See attached file: ProC.txt)

Attached below is the section of the C file that is generated.

(See attached file: ConvertedC.txt)

Could you please let us know any work around or rather a possible reason
for this error? Do we need to include any flag in this case also in order
to compile the C file successfully?


Warm Regards,
______________________________________________
Rachit Verma
External: +44 1455 89 5644
______________________________________________





Sven Eschenberg <eschenb@xxxxxxxxx ankfurt.de> To: Rachit.Verma@xxxxxxxxxxxxx cc: gcc-help@xxxxxxxxxxx 06/06/06 18:13 Subject: Re: Error during Pro*C compilation


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux