From: Ian Edwards (ian_at_concerto.demon.co.uk)
Date: Tue Aug 05 2003 - 18:37:25 BST
On 05-Aug-03 Gurr, David (MED, self) wrote:
> Hi, I am having difficulty with cg. With
> the trivial program "goodbye.c":
> =======================================
> extern int printf(const char *, ...);
>
> int test()
> {
> printf("test !\n");
> return 0;
> }
>
> int main()
> {
> printf("goodbye !\n");
> return 0;
> }
> =======================================
>
> This works:
> ./cg -e main goodbye.c
> This core dumps :
> ./cg -e test goodbye.c
Hello David,
in ups/cx_onefile.c change line 367 from
if (entry_name != NULL && strcmp(entry_name, "main") == 0) {
to
if (entry_name != NULL) {
This will allow the function specified by the '-e' option to be a real
alternative entry point, with access to the same parameters as "main", i.e.
main(argc, argv, envp)
int argc;
char **argv, **envp;
Regards,
Ian.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Ian Edwards <ian_at_concerto.demon.co.uk> 05-Aug-03 18:37:25
Early Music Record Labels - http://www.recordlabels.org/
'ups' debugger for C/C++/f77 - http://ups.sourceforge.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
This archive was generated by hypermail 2.1.4 : Tue Aug 05 2003 - 19:15:12 BST