Antti Karttunen | 27 Feb 22:11 2002
Picon

Three void C-functions returning values in the sources of scheme48 release 0.57. Is is harmful?


Dear Sirs,

I had to edit functions s48_post_gc_cleanup and s48_gc_root
in the source module c/scheme48vm.c
and the function s48_relocate_all in the module c/scheme48read-image.c
because they returned values, although they are defined as void
themselves. (So I just commented the return out, see the diffs below).

Question: will my build of scheme48 work after this change
(after the first gc also?),
or is that kind of C-coding involved with some higher cabbala
of weird garbage collection algorithms and Sparc's way of
transferring function return values?

Yours,

Antti Karttunen

Here are the details:

I compiled the scheme48 release 0.57 for SunOS 5.6 (in SunOS 5.8
machine)
with /opt/SUNWspro/bin/cc -xcg89

and the version of Sun's C-compiler is:
phys-staff3:/home/karttu/scheme48-0.57/c(52)% /opt/SUNWspro/bin/cc -V
cc: Sun WorkShop 6 update 1 C 5.2 2000/09/11
usage: cc [ options] files.  Use 'cc -flags' for details

(Continue reading)

RT Happe | 27 Feb 22:44 2002
Picon

Re: Three void C-functions returning values in the sources of scheme48 release 0.57. Is is harmful?

On Wed, 27 Feb 2002, Antti Karttunen wrote:
> and the function s48_relocate_all in the module c/scheme48read-image.c
> because they returned values, although they are defined as void

Actually, in all these cases the argument of the return has type void.
However, selon Harbison&Steele [277 4th ed.], if a function has a declared
return type of void, it is an error to supply an expression in any return
statement in the function.  This seems to exclude expressions of any type,
including calls to functions with void return value.

> Question: will my build of scheme48 work after this change
> (after the first gc also?),

I recall that ,collect forces gc.  So you may try.

rthappe

Antti Karttunen | 27 Feb 23:02 2002
Picon

Re: Three void C-functions returning values in the sources of scheme48release 0.57. Is is harmful?


RT Happe wrote:

> On Wed, 27 Feb 2002, Antti Karttunen wrote:
> > and the function s48_relocate_all in the module c/scheme48read-image.c
> > because they returned values, although they are defined as void
>
> Actually, in all these cases the argument of the return has type void.
> However, selon Harbison&Steele [277 4th ed.], if a function has a declared
> return type of void, it is an error to supply an expression in any return
> statement in the function.  This seems to exclude expressions of any type,
> including calls to functions with void return value.
>
> > Question: will my build of scheme48 work after this change
> > (after the first gc also?),
>
> I recall that ,collect forces gc.  So you may try.

Didn't crash (yet):

phys-staff3:/home/karttu/scheme48-0.57(17)% ./go
Welcome to Scheme 48 0.57 (made by karttu on Wed Feb 27 22:44:37 EET 2002).
Copyright (c) 1993-2001 by Richard Kelsey and Jonathan Rees.
Please report bugs to scheme-48-bugs <at> martigny.ai.mit.edu.
Type ,? (comma question-mark) for help.
> ,collect
Before: 1091387 words free in semispace
After:  1096570 words free in semispace
>

(Continue reading)


Gmane