unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* compilation warnings
@ 2003-07-04  4:36 Paul Jarc
  2003-07-27 16:56 ` Marius Vollmer
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Jarc @ 2003-07-04  4:36 UTC (permalink / raw)


If I use the "-Wwrite-strings -Wshadow" options for gcc while
compiling an extension, I get some warnings that I think could be
silenced:

.../smob.h:149: warning: declaration of `free' shadows a global declaration
.../smob.h:170: warning: declaration of `free' shadows a global declaration
.../smob.h:176: warning: declaration of `free' shadows a global declaration
.../ports.h:233: warning: declaration of `free' shadows a global declaration
.../numbers.h:258: warning: declaration of `div' shadows a global declaration
.../libguile-ldap.c:169: warning: passing arg 1 of `scm_make_smob_type' discards qualifiers from pointer target type

Is there some reason why scm_make_smob_type's first argument is char*
instead of char const*?  Should I submit a patch to silence these
warnings?


paul


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: compilation warnings
  2003-07-04  4:36 compilation warnings Paul Jarc
@ 2003-07-27 16:56 ` Marius Vollmer
  2003-07-28 22:37   ` Kevin Ryde
  2003-09-22 21:58   ` Paul Jarc
  0 siblings, 2 replies; 8+ messages in thread
From: Marius Vollmer @ 2003-07-27 16:56 UTC (permalink / raw)


prj@po.cwru.edu (Paul Jarc) writes:

> If I use the "-Wwrite-strings -Wshadow" options for gcc while
> compiling an extension, I get some warnings that I think could be
> silenced:
> 
> .../smob.h:149: warning: declaration of `free' shadows a global declaration
> .../smob.h:170: warning: declaration of `free' shadows a global declaration
> .../smob.h:176: warning: declaration of `free' shadows a global declaration
> .../ports.h:233: warning: declaration of `free' shadows a global declaration
> .../numbers.h:258: warning: declaration of `div' shadows a global declaration
> .../libguile-ldap.c:169: warning: passing arg 1 of `scm_make_smob_type' discards qualifiers from pointer target type
> 
> Is there some reason why scm_make_smob_type's first argument is char*
> instead of char const*?  Should I submit a patch to silence these
> warnings?

Yes, please do.  The shadow warnings seem annoying, but since there
are so few, we can just as well fix them.  I don't think using a
global name as a parameter name in a prototype can ever hurt...

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: compilation warnings
  2003-07-27 16:56 ` Marius Vollmer
@ 2003-07-28 22:37   ` Kevin Ryde
  2003-09-22 21:58   ` Paul Jarc
  1 sibling, 0 replies; 8+ messages in thread
From: Kevin Ryde @ 2003-07-28 22:37 UTC (permalink / raw)


Marius Vollmer <mvo@zagadka.de> writes:
>
> Yes, please do.  The shadow warnings seem annoying, but since there
> are so few, we can just as well fix them.  I don't think using a
> global name as a parameter name in a prototype can ever hurt...

It's a good idea to omit parameter names from prototypes entirely, so
there's no chance of conflicting with an application #define.  Not
that a sensible application would be making macros out of common
lower-case names, but just for namespace cleanliness.  Of course the
same can't be done for structure fields, unfortunately.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: compilation warnings
  2003-07-27 16:56 ` Marius Vollmer
  2003-07-28 22:37   ` Kevin Ryde
@ 2003-09-22 21:58   ` Paul Jarc
  2003-09-23  4:22     ` Rob Browning
  2003-10-07 16:00     ` Marius Vollmer
  1 sibling, 2 replies; 8+ messages in thread
From: Paul Jarc @ 2003-09-22 21:58 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 460 bytes --]

Here's a patch to silence some warnings produced by -Wwrite-strings.
(I only used -Wwrite-strings while compiling a Guile extension, not
Guile itself.  Using -Wwrite-strings for Guile itself would likely
produce lots more similar warnings, but none of them should be too
hard to fix.)

	* goops.c, objects.h, smob.c, smob.h: Make type names char
        const * instead of char *.

BTW, what version of auto* should be used to build/test CVS checkouts?


paul

[-- Attachment #2: guile-const.patch --]
[-- Type: text/x-patch, Size: 2535 bytes --]

Index: libguile/goops.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/goops.c,v
retrieving revision 1.71
diff -u -r1.71 goops.c
--- libguile/goops.c	18 Sep 2003 20:55:40 -0000	1.71
+++ libguile/goops.c	22 Sep 2003 21:48:05 -0000
@@ -2435,7 +2435,7 @@
  **********************************************************************/
 
 static SCM
-make_class_from_template (char *template, char *type_name, SCM supers, int applicablep)
+make_class_from_template (char const *template, char const *type_name, SCM supers, int applicablep)
 {
   SCM class, name;
   if (type_name)
@@ -2462,7 +2462,7 @@
 }
 
 SCM
-scm_make_extended_class (char *type_name, int applicablep)
+scm_make_extended_class (char const *type_name, int applicablep)
 {
   return make_class_from_template ("<%s>",
 				   type_name,
Index: libguile/objects.h
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/objects.h,v
retrieving revision 1.41
diff -u -r1.41 objects.h
--- libguile/objects.h	5 Apr 2003 19:10:22 -0000	1.41
+++ libguile/objects.h	22 Sep 2003 21:48:05 -0000
@@ -197,7 +197,7 @@
 SCM_API SCM scm_no_applicable_method;
 
 /* Goops functions. */
-SCM_API SCM scm_make_extended_class (char *type_name, int applicablep);
+SCM_API SCM scm_make_extended_class (char const *type_name, int applicablep);
 SCM_API void scm_i_inherit_applicable (SCM c);
 SCM_API void scm_make_port_classes (long ptobnum, char *type_name);
 SCM_API void scm_change_object_class (SCM, SCM, SCM);
Index: libguile/smob.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/smob.c,v
retrieving revision 1.58
diff -u -r1.58 smob.c
--- libguile/smob.c	18 Sep 2003 20:55:40 -0000	1.58
+++ libguile/smob.c	22 Sep 2003 21:48:05 -0000
@@ -269,7 +269,7 @@
 \f
 
 scm_t_bits 
-scm_make_smob_type (char *name, size_t size)
+scm_make_smob_type (char const *name, size_t size)
 #define FUNC_NAME "scm_make_smob_type"
 {
   long new_smob;
Index: libguile/smob.h
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/smob.h,v
retrieving revision 1.48
diff -u -r1.48 smob.h
--- libguile/smob.h	5 Apr 2003 19:10:22 -0000	1.48
+++ libguile/smob.h	22 Sep 2003 21:48:05 -0000
@@ -30,7 +30,7 @@
 
 typedef struct scm_smob_descriptor
 {
-  char *name;
+  char const *name;
   size_t size;
   SCM (*mark) (SCM);
   size_t (*free) (SCM);

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: compilation warnings
  2003-09-22 21:58   ` Paul Jarc
@ 2003-09-23  4:22     ` Rob Browning
  2003-09-23 16:19       ` Paul Jarc
  2003-10-07 16:00     ` Marius Vollmer
  1 sibling, 1 reply; 8+ messages in thread
From: Rob Browning @ 2003-09-23  4:22 UTC (permalink / raw)


prj@po.cwru.edu (Paul Jarc) writes:

> 	* goops.c, objects.h, smob.c, smob.h: Make type names char
>         const * instead of char *.
>
> BTW, what version of auto* should be used to build/test CVS checkouts?

The general rule of thumb is, for HEAD, the most recent stable
versions.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: compilation warnings
  2003-09-23  4:22     ` Rob Browning
@ 2003-09-23 16:19       ` Paul Jarc
  2003-09-24  6:11         ` Rob Browning
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Jarc @ 2003-09-23 16:19 UTC (permalink / raw)


Rob Browning <rlb@defaultvalue.org> wrote:
> prj@po.cwru.edu (Paul Jarc) writes:
>> BTW, what version of auto* should be used to build/test CVS checkouts?
>
> The general rule of thumb is, for HEAD, the most recent stable
> versions.

That's not especially useful advice, though.  After a new autoconf
release, Guile won't be updated instantly; it'll take some time.
Maybe a significant amount of time in pathological cases, but in any
case, how will we know?

Also, which tools do we need?  Guile has its own libtool, right?  So
just autoconf and automake?


paul


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: compilation warnings
  2003-09-23 16:19       ` Paul Jarc
@ 2003-09-24  6:11         ` Rob Browning
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Browning @ 2003-09-24  6:11 UTC (permalink / raw)


prj@po.cwru.edu (Paul Jarc) writes:

> That's not especially useful advice, though.  After a new autoconf
> release, Guile won't be updated instantly; it'll take some time.
> Maybe a significant amount of time in pathological cases, but in any
> case, how will we know?

Depends on what you mean.  Distribution .tar.gzs (of course) aren't
supposed to require any of the autotools, but if you're building from
CVS, then we reserve the right to require the latest versions.
However, at any given time, we probably only require some fairly
recent version.

Right now I'm using automake 1.7.7 and autoconf 2.57. so whenever I'm
working on unstable, I'll be making sure we're compatible with that.
(Just tested an ./autogen.sh on unstable, and it seems OK...)

If you mean how would someone who wants to work on a 1.6.X tarfile
know which autotools to use, then that's tougher.  Right now we just
supply a list of versions known not to work in HACKING.  Ideally,
they'd just be able to use the latest tools as well.  Frankly, I'd
consider a failure to build using the latest autotools important
enough to warrant a stable point release.

> Also, which tools do we need?  Guile has its own libtool, right?  So
> just autoconf and automake?

You actually do need autoconf, automake, and libtool.  We have our own
version of ltdl, but you'll still need libtool for all the rest:
compilation, etc. (or more specifically, so ./autogen.sh can run
libtoolize).

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: compilation warnings
  2003-09-22 21:58   ` Paul Jarc
  2003-09-23  4:22     ` Rob Browning
@ 2003-10-07 16:00     ` Marius Vollmer
  1 sibling, 0 replies; 8+ messages in thread
From: Marius Vollmer @ 2003-10-07 16:00 UTC (permalink / raw)


prj@po.cwru.edu (Paul Jarc) writes:

> Here's a patch to silence some warnings produced by -Wwrite-strings.

Applied, thanks!

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-10-07 16:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-04  4:36 compilation warnings Paul Jarc
2003-07-27 16:56 ` Marius Vollmer
2003-07-28 22:37   ` Kevin Ryde
2003-09-22 21:58   ` Paul Jarc
2003-09-23  4:22     ` Rob Browning
2003-09-23 16:19       ` Paul Jarc
2003-09-24  6:11         ` Rob Browning
2003-10-07 16:00     ` Marius Vollmer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).