This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: scm_must_* and K&R C


forcer <forcer@mindless.com> writes:
> Guile uses K&R C for backwards compatibility. That's ok, but it
> gets annoying when you have to cast your return values of
> scm_must_malloc or the parameter for scm_must_free each time just
> to prevent those stupid warnings.

Last I checked, "K&R C" didn't include prototype support.

If we're using prototypes unconditionally, we can probably use void*
unconditionally, can't we?

> +#ifdef __STDC__
> +
> +extern void * scm_must_malloc (scm_sizet len, const char *what);
> +extern void * scm_must_realloc (void *where,
> +				scm_sizet olen, scm_sizet len,
> +				const char *what);
> +extern void scm_must_free (void *obj);
> +#else
>  extern char * scm_must_malloc (scm_sizet len, const char *what);
>  extern char * scm_must_realloc (char *where,
>  				scm_sizet olen, scm_sizet len,
>  				const char *what);
> -extern void scm_done_malloc (long size);
>  extern void scm_must_free (char *obj);
> +#endif /* __STDC__ */
> +extern void scm_done_malloc (long size);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]