Skip to contentSkip to conversation

move variable declaration to top of function

PATCH In review Heiko Hund 3 participants 3 messages Feb 17, 2012

lore
Share & tools
lore

Heiko Hund

author
#0 lore raw

PATCH 1/1 move variable declaration to top of function

MSVC chokes on this as it's not according to C89.

---
 buffer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
buffer.c +1 -1
index 6800e6e..391085b 100644
@@ -321,9 +321,9 @@ gc_malloc (size_t size, bool clear, struct gc_arena *a)
 #endif
 {
   void *ret;
+  struct gc_entry *e;
   ASSERT (NULL != a);
 
-  struct gc_entry *e;
 #ifdef DMALLOC
   e = (struct gc_entry *) openvpn_dmalloc (file, line, size + sizeof (struct gc_entry));
 #else
Signature · 1 line
1.7.5.4
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 4 lines · Heiko Hund

MSVC chokes on this as it's not according to C89.

+- 1 files changed, 1 insertions(+), 1 deletions(-)

ACK! Applied to master on -testing and stable trees.

commit 175383fec9cd2d891cfd3f2673b6549822fdfa47

Author: Heiko Hund <[email protected]...>
Date:   Fri Feb 17 09:39:35 2012 +0100
    move variable declaration to top of function

    MSVC chokes on this as it's not according to C89.

    Signed-off-by: Heiko Hund <[email protected]...>
    Acked-by: David Sommerseth <[email protected]...>
    Signed-off-by: David Sommerseth <[email protected]...>

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk8+KQYACgkQDC186MBRfrpetwCfXPs76FCzCiLbmDzS0wD77cxZ +j8AoJ+pYBXQfyplScerR77HQlhKX89E
=ZIdx
-----END PGP SIGNATURE-----

#2 lore raw
In reply to Heiko Hund

Hi,

Quoted 12 lines · Heiko Hund

MSVC chokes on this as it's not according to C89.

---
 buffer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
buffer.c +0 -0
index 6800e6e..391085b 100644

buffer.c gc_malloc (size_t size, bool clear, struct gc_arena *a) · line 326

Quoted 7 lines
buffer.c +1 -1
@@ -321,9 +321,9 @@ gc_malloc (size_t size, bool clear, struct gc_arena *a)
 #endif
 {
   void *ret;
+  struct gc_entry *e;
   ASSERT (NULL != a);
 
-  struct gc_entry *e;

Ack. This has bitten me as well :)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...