Pro*C / C++ ??

From: David Hudek <hudek_at_polaris.llnl.gov>
Date: 7 Jan 93 22:26:49 GMT
Message-ID: <145384_at_lll-winken.LLNL.GOV>


<||>

Question about Oracle's Pro*C precompiler:

As I understand it and from a quick look at some output, this simply takes source code statements that start with a key phrase (EXEC SQL...) and translates them into C code and Oracle system calls.

Given that, is there any reason why the output of Pro*C couldn't then be run through Sun's C++ compiler and produce good executables? (since the C++ compiler can obviously handle straight C code).

We're in the process of moving from an old Sequent box to a Sun Workstation/Fileserver mode of operation and for various reasons (maintenance agreements, licenses, upgrades, beauracracy) it's much more convenient to pay for just a C++ compiler and drop the separate C compiler. We would initially still be writing code in C, but with the intent to migrate to C++ in the future.

It seems like this should work out OK, but has anyone actually done it? I've written a number of applications in C with embedded SQL, using the Pro*C precompiler on the Sequent, but just as a useful system capability... I didn't install/administer it and the person who did is no longer here. Are there any strange administrative quirks to be aware of? Reasons why Pro*C and the C++ compiler won't work together on a Sun?

The only potential problem I can think of at the moment from a programming standpoint is how function declarations are handled... Pro*C outputs something like "void sqlxxx1();" in the traditional C style, with the parameters unspecified. I don't know if the latest Sun compilers require functions to be declared in prototype form (i.e., the parameter types to also be declared at the time the function is, like "void sqlxxx1(int, float);" for example).

Any advice/help? Will it work?

Thanks in advance,
dave hudek
djh_at_llnl.gov

< standard disclaimer: these are personal opinions only > < I do not speak for any organization > Received on Thu Jan 07 1993 - 23:26:49 CET

Original text of this message