Skip to contentSkip to conversation

qom: Fix "typddef" typo

PATCH Applied Eduardo Habkost 5 participants 7 messages Oct 7, 2020 – Oct 13, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qom: Fix "typddef" typo

Fix typo introduced in the C11 #ifdef for qemu_max_align_t. It never caused any problems because we always compile using -std=gnu99.

Fixes 4c880f363e9e ("qom: Allow objects to be allocated with increased alignment")
---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +1 -1
index c335dce7e4..125dabd28b 100644
@@ -692,7 +692,7 @@ static void object_finalize(void *data)
 
 /* Find the minimum alignment guaranteed by the system malloc. */
 #if __STDC_VERSION__ >= 201112L
-typddef max_align_t qemu_max_align_t;
+typedef max_align_t qemu_max_align_t;
 #else
 typedef union {
     long l;
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Eduardo Habkost

Fix typo introduced in the C11 #ifdef for qemu_max_align_t. It never caused any problems because we always compile using -std=gnu99.

Fixes 4c880f363e9e ("qom: Allow objects to be allocated with increased

alignment")

Quoted 22 lines
---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +1 -2
index c335dce7e4..125dabd28b 100644
@@ -692,7 +692,7 @@ static void object_finalize(void *data)
 
 /* Find the minimum alignment guaranteed by the system malloc. */
 #if __STDC_VERSION__ >= 201112L
-typddef max_align_t qemu_max_align_t;
+typedef max_align_t qemu_max_align_t;
 #else
 typedef union {
     long l;
--

2.26.2

Signature · 1 line
Marc-André Lureau
Reviewed-by on v1 1/1
#2 lore raw
In reply to Eduardo Habkost
Quoted 15 lines · Eduardo Habkost

Fix typo introduced in the C11 #ifdef for qemu_max_align_t. It never caused any problems because we always compile using -std=gnu99.

Fixes 4c880f363e9e ("qom: Allow objects to be allocated with increased alignment")
---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +0 -0
index c335dce7e4..125dabd28b 100644

qom/object.c static void object_finalize(void *data) · line 695

Quoted 5 lines
qom/object.c +1 -1
@@ -692,7 +692,7 @@ static void object_finalize(void *data)
 
 /* Find the minimum alignment guaranteed by the system malloc. */
 #if __STDC_VERSION__ >= 201112L
-typddef max_align_t qemu_max_align_t;
+typedef max_align_t qemu_max_align_t;

Oops

Quoted 4 lines
qom/object.c +0 -0
 #else
 typedef union {
     long l;
#3 lore raw
In reply to Eduardo Habkost

Le 08/10/2020 à 00:02, Eduardo Habkost a écrit :

Quoted 16 lines

Fix typo introduced in the C11 #ifdef for qemu_max_align_t. It never caused any problems because we always compile using -std=gnu99.

Fixes 4c880f363e9e ("qom: Allow objects to be allocated with increased alignment")
---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +0 -0
index c335dce7e4..125dabd28b 100644

qom/object.c static void object_finalize(void *data) · line 698

Quoted 8 lines
qom/object.c +1 -1
@@ -692,7 +692,7 @@ static void object_finalize(void *data)
 
 /* Find the minimum alignment guaranteed by the system malloc. */
 #if __STDC_VERSION__ >= 201112L
-typddef max_align_t qemu_max_align_t;
+typedef max_align_t qemu_max_align_t;
 #else
 typedef union {
     long l;

Applied to my trivial-patches branch.

Thanks,
Laurent

#4 lore raw
In reply to Eduardo Habkost
Quoted 15 lines · Eduardo Habkost

Fix typo introduced in the C11 #ifdef for qemu_max_align_t. It never caused any problems because we always compile using -std=gnu99.

Fixes 4c880f363e9e ("qom: Allow objects to be allocated with increased alignment")
---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +0 -0
index c335dce7e4..125dabd28b 100644

qom/object.c static void object_finalize(void *data) · line 696

Quoted 6 lines
qom/object.c +1 -1
@@ -692,7 +692,7 @@ static void object_finalize(void *data)
 
 /* Find the minimum alignment guaranteed by the system malloc. */
 #if __STDC_VERSION__ >= 201112L
-typddef max_align_t qemu_max_align_t;
+typedef max_align_t qemu_max_align_t;
 #else

Why do we need / have this first part of the #if at all ? We unconditionally add -std=gnu99, so surely this has always been dead code and can just be better deleted.

Quoted 5 lines
qom/object.c +0 -0
 typedef union {
     long l;
Signature · 1 line
2.26.2

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#5 lore raw

Le 12/10/2020 à 16:45, Daniel P. Berrangé a écrit :

Quoted 17 lines · Eduardo Habkost
Quoted 16 lines

Fix typo introduced in the C11 #ifdef for qemu_max_align_t. It never caused any problems because we always compile using -std=gnu99.

Fixes 4c880f363e9e ("qom: Allow objects to be allocated with increased alignment")
---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +0 -0
index c335dce7e4..125dabd28b 100644
@@ -692,7 +692,7 @@ static void object_finalize(void *data)
 
Quoted 10 lines

qom/object.c static void object_finalize(void *data) · line 696

Quoted 5 lines
qom/object.c +1 -1
 /* Find the minimum alignment guaranteed by the system malloc. */
 #if __STDC_VERSION__ >= 201112L
-typddef max_align_t qemu_max_align_t;
+typedef max_align_t qemu_max_align_t;
 #else

Why do we need / have this first part of the #if at all ? We unconditionally add -std=gnu99, so surely this has always been dead code and can just be better deleted.

I've removed the patch from my queue.

But perhaps it will be needed in the future if we switch to a newer standard version?

Thanks,
Laurent

#6 lore raw
In reply to Daniel P. Berrangé
Quoted 17 lines · Daniel P. Berrangé
Quoted 16 lines · Eduardo Habkost

Fix typo introduced in the C11 #ifdef for qemu_max_align_t. It never caused any problems because we always compile using -std=gnu99.

Fixes 4c880f363e9e ("qom: Allow objects to be allocated with increased alignment")
---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qom/object.c +0 -0
index c335dce7e4..125dabd28b 100644
@@ -692,7 +692,7 @@ static void object_finalize(void *data)
 
Quoted 9 lines

qom/object.c static void object_finalize(void *data) · line 696

Quoted 5 lines
qom/object.c +1 -1
 /* Find the minimum alignment guaranteed by the system malloc. */
 #if __STDC_VERSION__ >= 201112L
-typddef max_align_t qemu_max_align_t;
+typedef max_align_t qemu_max_align_t;
 #else

Why do we need / have this first part of the #if at all ? We unconditionally add -std=gnu99, so surely this has always been dead code and can just be better deleted.

It has the same function as a comment saying "we can use max_align_t as soon as we move to C11". The difference is that it doesn't need us to manually change the code once we do.

Signature · 1 line
Eduardo