* Current git unitialized vars warnings.
@ 2009-07-01 16:43 dsmich
2009-07-14 15:15 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: dsmich @ 2009-07-01 16:43 UTC (permalink / raw)
To: guile-devel
[-- 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) \
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: Current git unitialized vars warnings.
2009-07-01 16:43 Current git unitialized vars warnings dsmich
@ 2009-07-14 15:15 ` Ludovic Courtès
2009-07-23 21:27 ` Andy Wingo
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2009-07-14 15:15 UTC (permalink / raw)
To: guile-devel
Hi,
<dsmich@roadrunner.com> writes:
> 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).
I'm not seeing it myself (GCC 4.3.3, x86_64-linux-gnu), but I committed
it just in case (I did encounter situations in the past where GCC
misdiagnoses uninitialized variables.)
Note to Andy: the GCS recommends against assignments in `if' expressions
(info "(standards)Syntactic Conventions"). :-)
Thank you!
Ludo'.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-23 21:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 16:43 Current git unitialized vars warnings dsmich
2009-07-14 15:15 ` Ludovic Courtès
2009-07-23 21:27 ` Andy Wingo
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).