unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: <dsmich@roadrunner.com>
To: guile-devel@gnu.org
Subject: Current git unitialized vars warnings.
Date: Wed, 1 Jul 2009 12:43:26 -0400	[thread overview]
Message-ID: <20090701164327.JW87G.291209.root@cdptpa-web25-z02> (raw)

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

The new vector vm code gives me quite a few "possible use uninitialized" warnings.

On debian Etch:

$ gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

Patch attached (I hope).

-Dale



[-- Attachment #2: init-vars.patch --]
[-- Type: application/octet-stream, Size: 4219 bytes --]

diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c
index 5de39a2..b036a5b 100644
--- a/libguile/vm-i-scheme.c
+++ b/libguile/vm-i-scheme.c
@@ -281,7 +281,7 @@ VM_DEFINE_INSTRUCTION (108, slot_set, "slot-set", 0, 3, 0)
 
 VM_DEFINE_FUNCTION (109, vector_ref, "vector-ref", 2)
 {
-  long i;
+  long i=0;
   ARGS2 (vect, idx);
   if (SCM_LIKELY (SCM_I_IS_VECTOR (vect)
                   && SCM_I_INUMP (idx)
@@ -294,7 +294,7 @@ VM_DEFINE_FUNCTION (109, vector_ref, "vector-ref", 2)
 
 VM_DEFINE_INSTRUCTION (110, vector_set, "vector-set", 0, 3, 0)
 {
-  long i;
+  long i=0;
   SCM vect, idx, val;
   POP (val); POP (idx); POP (vect);
   if (SCM_LIKELY (SCM_I_IS_VECTOR (vect)
@@ -346,7 +346,7 @@ BV_REF_WITH_ENDIANNESS (f64, ieee_double)
 
 #define BV_FIXABLE_INT_REF(stem, fn_stem, type, size)                   \
 {                                                                       \
-  long i;                                                               \
+  long i=0;                                                             \
   ARGS2 (bv, idx);                                                      \
   VM_VALIDATE_BYTEVECTOR (bv);                                          \
   if (SCM_LIKELY (SCM_I_INUMP (idx)                                     \
@@ -361,7 +361,7 @@ BV_REF_WITH_ENDIANNESS (f64, ieee_double)
 
 #define BV_INT_REF(stem, type, size)                                    \
 {                                                                       \
-  long i;                                                               \
+  long i=0;                                                             \
   ARGS2 (bv, idx);                                                      \
   VM_VALIDATE_BYTEVECTOR (bv);                                          \
   if (SCM_LIKELY (SCM_I_INUMP (idx)                                     \
@@ -380,7 +380,7 @@ BV_REF_WITH_ENDIANNESS (f64, ieee_double)
 
 #define BV_FLOAT_REF(stem, fn_stem, type, size)                         \
 {                                                                       \
-  long i;                                                               \
+  long i=0;                                                             \
   ARGS2 (bv, idx);                                                      \
   VM_VALIDATE_BYTEVECTOR (bv);                                          \
   if (SCM_LIKELY (SCM_I_INUMP (idx)                                     \
@@ -454,7 +454,7 @@ BV_SET_WITH_ENDIANNESS (f64, ieee_double)
 
 #define BV_FIXABLE_INT_SET(stem, fn_stem, type, min, max, size)         \
 {                                                                       \
-  long i, j;                                                            \
+  long i=0, j=0;                                                        \
   SCM bv, idx, val; POP (val); POP (idx); POP (bv);                     \
   VM_VALIDATE_BYTEVECTOR (bv);                                          \
   if (SCM_LIKELY (SCM_I_INUMP (idx)                                     \
@@ -472,7 +472,7 @@ BV_SET_WITH_ENDIANNESS (f64, ieee_double)
 
 #define BV_INT_SET(stem, type, size)                                    \
 {                                                                       \
-  long i;                                                               \
+  long i=0;                                                             \
   SCM bv, idx, val; POP (val); POP (idx); POP (bv);                     \
   VM_VALIDATE_BYTEVECTOR (bv);                                          \
   if (SCM_LIKELY (SCM_I_INUMP (idx)                                     \
@@ -487,7 +487,7 @@ BV_SET_WITH_ENDIANNESS (f64, ieee_double)
 
 #define BV_FLOAT_SET(stem, fn_stem, type, size)                         \
 {                                                                       \
-  long i;                                                               \
+  long i=0;                                                             \
   SCM bv, idx, val; POP (val); POP (idx); POP (bv);                     \
   VM_VALIDATE_BYTEVECTOR (bv);                                          \
   if (SCM_LIKELY (SCM_I_INUMP (idx)                                     \

             reply	other threads:[~2009-07-01 16:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01 16:43 dsmich [this message]
2009-07-14 15:15 ` Current git unitialized vars warnings Ludovic Courtès
2009-07-23 21:27   ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090701164327.JW87G.291209.root@cdptpa-web25-z02 \
    --to=dsmich@roadrunner.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).