[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/5] i386: Add explicit array size to x86_cpu_vendor
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH 1/5] i386: Add explicit array size to x86_cpu_vendor_words2str() |
Date: |
Sun, 8 Jan 2017 17:40:37 -0200 |
Add explicit array size to x86_cpu_vendor_words2str() to let the
compiler check if we are really passing an array of the right
size.
GCC still doesn't print a warning when the array is too small[1],
but clang already does.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50584
Signed-off-by: Eduardo Habkost <address@hidden>
---
target/i386/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index a149c8dc42..25b802bb06 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -169,7 +169,7 @@
-static void x86_cpu_vendor_words2str(char *dst, uint32_t vendor1,
+static void x86_cpu_vendor_words2str(char dst[static (CPUID_VENDOR_SZ + 1)],
uint32_t vendor1,
uint32_t vendor2, uint32_t vendor3)
{
int i;
--
2.11.0.259.g40922b1
- [Qemu-devel] [PATCH 0/5] Use non-blacklisted family/model/stepping for Haswell CPU model, Eduardo Habkost, 2017/01/08
- [Qemu-devel] [PATCH 2/5] i386: host_vendor_fms() helper function, Eduardo Habkost, 2017/01/08
- [Qemu-devel] [PATCH 1/5] i386: Add explicit array size to x86_cpu_vendor_words2str(),
Eduardo Habkost <=
- [Qemu-devel] [PATCH 3/5] i386/kvm: Blacklist TSX on known broken hosts, Eduardo Habkost, 2017/01/08
- [Qemu-devel] [PATCH 5/5] i386: Change stepping of Haswell to non-blacklisted value, Eduardo Habkost, 2017/01/08
- [Qemu-devel] [PATCH 4/5] pc: Add 2.9 machine-types, Eduardo Habkost, 2017/01/08
- Re: [Qemu-devel] [PATCH 0/5] Use non-blacklisted family/model/stepping for Haswell CPU model, no-reply, 2017/01/08
- Re: [Qemu-devel] [PATCH 0/5] Use non-blacklisted family/model/stepping for Haswell CPU model, Dr. David Alan Gilbert, 2017/01/09