sizeof(void) is 1
authorMatthias Braun <matze@braunis.de>
Tue, 25 Oct 2011 10:55:44 +0000 (12:55 +0200)
committerMatthias Braun <matze@braunis.de>
Thu, 27 Oct 2011 10:20:37 +0000 (12:20 +0200)
This only matters when GNU mode is enabled, but then you can perform
pointer arithmetic with void in which case its size should also be 1

type.c

diff --git a/type.c b/type.c
index a0ee6e3..8ba008d 100644 (file)
--- a/type.c
+++ b/type.c
@@ -83,8 +83,8 @@ type_t *allocate_type_zero(type_kind_t kind)
  */
 atomic_type_properties_t atomic_type_properties[ATOMIC_TYPE_LAST+1] = {
        [ATOMIC_TYPE_VOID] = {
-               .size      = 0,
-               .alignment = 0,
+               .size      = 1,
+               .alignment = 1,
                .flags     = ATOMIC_TYPE_FLAG_NONE,
                .rank      = 0,
        },