guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Unnecessary warnings


From: Bruce Korb
Subject: Unnecessary warnings
Date: Sun, 24 Sep 2006 08:42:07 -0700
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)

/usr/local/gnu/include/libguile/smob.h:149: warning: declaration of 'free' 
shadows a global declaration
/usr/local/gnu/include/libguile/filesys.h:75: warning: declaration of 'dirname' 
shadows a global declaration
/usr/local/gnu/include/libguile/ports.h:233: warning: declaration of 'write' 
shadows a global declaration
/usr/local/gnu/include/libguile/ports.h:254: warning: declaration of 'truncate' 
shadows a global declaration
/usr/local/gnu/include/libguile/numbers.h:258: warning: declaration of 'div' 
shadows a global declaration
/usr/local/gnu/include/libguile/stime.h:55: warning: declaration of 'time' 
shadows a global declaration
/usr/include/iso/time_iso.h:91: warning: shadowed declaration is here
/usr/local/gnu/include/libguile/stime.h:56: warning: declaration of 'time' 
shadows a global declaration
/usr/include/iso/time_iso.h:91: warning: shadowed declaration is here
/usr/local/gnu/include/libguile/stime.h:60: warning: declaration of 'stime' 
shadows a global declaration

These are all due to argument names in prototype declarations.
Please suffix the names with "_arg" or something.
Meanwhile, compilations will choke with -Wshadow.


/usr/local/gnu/include/libguile/gsubr.h:65: warning: function declaration isn't 
a prototype
/usr/local/gnu/include/libguile/gsubr.h:68: warning: function declaration isn't 
a prototype
/usr/local/gnu/include/libguile/gsubr.h:70: warning: function declaration isn't 
a prototype
/usr/local/gnu/include/libguile/gsubr.h:73: warning: function declaration isn't 
a prototype
/usr/local/gnu/include/libguile/gsubr.h:81: warning: function declaration isn't 
a prototype
/usr/local/gnu/include/libguile/gsubr.h:86: warning: function declaration isn't 
a prototype

Here, the complaint is about stuff like this:

extern SCM scm_c_make_gsubr (const char *name, int req, int opt, int rst, SCM (*fcn) ());

where "fcn" does not look like a prototype.  It needs "(void)" as the
argument list.  Better is to:

  typedef SCM (scm_gsubr_callout_t) __P((void));

and use "scm_gsubr_callout_t *" in the argument list.  This works with
K&R, by the way.

Thanks - Bruce





reply via email to

[Prev in Thread] Current Thread [Next in Thread]