Hi Christoph,
The problem seems to be the printf in the destructor, where I assume you
actually meant to write id and not Ext0. It seems like the compiler now
tries to look up Ext0, but since it's already trying to instantiate Ext0
it somehow ends up in a loop and overflows the stack. I'll add a bug
about this to our tracker.
Cheers,
Per Östlund
2011-06-17 13:07, Christoph Höger skrev:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
testing this model crashes omc (r9308). Any ideas why?
model Ext1
class ExtO
extends ExternalObject;
function constructor "Strlen"
annotation(Include = "#include<string.h>");
input String idName;
output ExtO eo;
external "C" eo = strlen(idName);
end constructor;
function destructor "Printout"
annotation(Include = "#include<stdio.h>");
input ExtO id;
external "C" printf("strlen was: %d\n", ExtO);
end destructor;
end ExtO;
ExtO ext = ExtO("name");
Real x;
equation
x = time;
end Ext1;
- --
Christoph Höger
Technische Universität Berlin
Fakultät IV - Elektrotechnik und Informatik
Übersetzerbau und Programmiersprachen
Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin
Tel.: +49 (30) 314-24890
E-Mail: [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAk37NVUACgkQhMBO4cVSGS/fIgCeJNEGzyiBy80FZGBcxhSUx9ez
HdwAoJ4AoNhJGZUv/pDki305FwUNy+Me
=R4AM
-----END PGP SIGNATURE-----