Does ecpg understand forward declarations?
Sam Liapis <[email protected]> Wed, 1 Aug 2018 16:53:25 +1000
| Newsgroups | gmane.comp.db.postgresql.interfaces |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------F03BCB632A90C9D9E7A74BF8
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
|I'm a newbie to postgresql and ecpg in particular. My brief is to
'convert' Oracle pro*C files ready for ecpg preprocessing. I've so far
struck what appears to be ecpg limitation such as multi-dim arrays,
function pointers and void type. But the one that's biting hard right
now is ecpg seems to be unaware of or ignores forward declarations. Take
the classic scenario of mutually dependent structs A & B shown below.
ECPG keeps bailing with "ERROR: unrecognized data type name struct B"
(at line 100) If I remove the forward declaration its the same error for
line 110 (|||structB*ptr;|) 100 structB; 101 102 structA {...110 structB*ptr;111
};112 113 structB {...120 structA*ptr;121 }; Can someone confirm this
indeed is a shortcoming of ecpg and suggest any way around it? Thanks, Sam |
--------------F03BCB632A90C9D9E7A74BF8
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<pre class="lang-cpp prettyprint prettyprinted" style=""><code><span class="kwd">
I'm a newbie to postgresql and ecpg in particular.
My brief is to 'convert' Oracle pro*C files ready for ecpg preprocessing.
I've so far struck what appears to be ecpg limitation such as multi-dim arrays, function pointers and void type.
But the one that's biting hard right now is ecpg seems to be unaware of or ignores forward declarations.
Take the classic scenario of mutually dependent structs A & B shown below.
ECPG keeps bailing with "ERROR: unrecognized data type name struct B" (at line 100)
If I remove the forward declaration its the same error for line 110 (</span></code><code><span class="kwd"><code><span class="kwd">struct</span><span class="pln"> B</span><span class="pun">*</span><span class="pln"> ptr</span><span class="pun">;</span></code>)
100 struct</span><span class="pln"> B</span><span class="pun">;
101
</span><span class="pln"></span><span class="kwd">102 struct</span><span class="pln"> A </span><span class="pun">{</span><span class="pln">
</span><span class="pun">...</span><span class="pln">
110 </span><span class="kwd">struct</span><span class="pln"> B</span><span class="pun">*</span><span class="pln"> ptr</span><span class="pun">;</span><span class="pln">
</span><span class="pun">111 };</span><span class="pln">
</span><span class="kwd">112
113 struct</span><span class="pln"> B </span><span class="pun">{</span><span class="pln">
</span><span class="pun">...</span><span class="pln">
120 </span><span class="kwd">struct</span><span class="pln"> A</span><span class="pun">*</span><span class="pln"> ptr</span><span class="pun">;</span><span class="pln">
</span><span class="pun">121 };
Can someone confirm this indeed is a shortcoming of ecpg and suggest any way around it?
Thanks,
Sam
</span></code></pre>
</body>
</html>
--------------F03BCB632A90C9D9E7A74BF8--