I get a segmentation fault when writing to stdout or stderr inside a GPC module called from a C program. I guess I have to set something manually that would be set automatically by the pascal main that isn't set by a c main, but I can't find any reference to this problem in the documentation. --Chris Ferrall ---------------------- C main --------------------- #include <stdio.h> extern Bug(); main () { Bug(); } ---------------------- Pascal module ---------------- module bug; uses GPC ; procedure bug; External; procedure bug; var f : text; begin rewrite(f,'cstring.txt'); writeln(f,'writing to text file okay '); close(f); (* Either of the following commands will cause a segmentation fault *) writeln('writing to standard output not okay'); writeln(StdErr,'writing to stderr not okay'); end; end.
Christopher Ferrall wrote:
I get a segmentation fault when writing to stdout or stderr inside a GPC module called from a C program. I guess I have to set something manually that would be set automatically by the pascal main that isn't set by a c main, but I can't find any reference to this problem in the documentation.
See ~gpc/p/demos/gpc_c* Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707
participants (2)
-
Christopher Ferrall -
Frank Heckenbach