Domanda

I need to use Oracle pro*C for dealing with EXEC SQL declaration. However I've got some macros in the SQL part that I want to replace by preprocessing with gnuC.

The problem is that from version 4, gnuC preprocessing adds keywords like __extension__. The pro*C preprocessor rejects __extension__ with the following message:

Syntax error at line 16, column 15, file xxx.ppc:
Error at line 16, column 15 in file xxx.ppc
__extension__ typedef unsigned long long int __u_quad_t;
..............1
PCC-S-02201, Encountered the symbol "typedef" when expecting one of the followin
g:

   ; , = ( [
The symbol ";" was substituted for "typedef" to continue.

How to make gnuC not to produce those keywords?

Thanks

È stato utile?

Soluzione 2

It seems that we can almost do it the other way: relaxing pro*C requirements, using the argument parse=partial.

See: https://stackoverflow.com/a/2468655/185460

But in this case the macro used in VARCHAR declarations for example are not replaced. So the problem remains!

Altri suggerimenti

You might be able to get rid of __extension__ with the C preprocessor. Place the following before #includes of headers that contain __extension__:

#define __extension__

This then converts __extension__ to thin air.

But I'm not sure if it will work; I don't know the order in which things are happening with pro*C (more specifically, how pro*C and CPP work together).

Also, this may lead to other problems caused by removing it. This simply means that you may have to do other CPP trickery to get it all working.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top