sac2c fails to compile classtype referenced more than once
|
|
Bugzilla Link |
929 |
Created on |
Mar 06, 2012 19:23 |
Resolution |
WORKSFORME |
Resolved on |
Mar 07, 2012 04:21 |
Version |
1.00beta |
OS |
Linux |
Architecture |
PC |
Extended Description
I have this great idea how to write SAC image format parsing code.
Really great! However, my road to progress and fame is continuously
hindered by the bugs in sac2c... Here's another one. I simplified
the code as much as a I could to help you fix it as fast as you can,
because I need it! :-)
sac2c complains thus:
sac2c -v0 -g -O3 -linksetsize 0 -mt X.sac -o lib
ERROR: line 13 file: X.sac
ERROR: Unique var x of type X referenced more than once
ERROR: line 11 file: X.sac
ERROR: Previous reference was here
*** Compilation failed ***
*** Exit code 66 (Checking uniqueness property of objects)
*** 2 Error(s), 0 Warning(s)
About the code from the file X.sac which you can find below.
I varied with pragma's like refcounting, etc. All without help.
Here comes the code:
class X;
external classtype;
export all;
void readX()
{
x = openX();
readHeader( x);
readData( x);
}
external X openX();
#pragma effect FileSystem::TheFileSystem
#pragma linkobj "x.o"
#pragma linkname "SAC_X_open"
external void readHeader( X x);
#pragma effect FileSystem::TheFileSystem
#pragma linkobj "x.o"
#pragma linkname "SAC_X_read_header"
external void readData( X x);
#pragma effect FileSystem::TheFileSystem
#pragma linkobj "x.o"
#pragma linkname "SAC_X_read_data"