From patchwork Fri Sep 28 08:32:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10619153 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1D2B1174A for ; Fri, 28 Sep 2018 08:33:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10A3228497 for ; Fri, 28 Sep 2018 08:33:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04FD92863D; Fri, 28 Sep 2018 08:33:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D14928497 for ; Fri, 28 Sep 2018 08:33:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729223AbeI1Ozz (ORCPT ); Fri, 28 Sep 2018 10:55:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51582 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726971AbeI1Ozy (ORCPT ); Fri, 28 Sep 2018 10:55:54 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58DAB8CD0; Fri, 28 Sep 2018 08:33:17 +0000 (UTC) Received: from thuth.com (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id A83E320155E2; Fri, 28 Sep 2018 08:33:15 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?b?UmFk?= =?utf-8?b?aW0gS3LEjW3DocWZ?= Cc: David Hildenbrand , Drew Jones , Janosch Frank Subject: [kvm-unit-tests PATCH 1/4] x86: Declare local functions as "static" and specify argument types Date: Fri, 28 Sep 2018 10:32:59 +0200 Message-Id: <1538123582-17442-2-git-send-email-thuth@redhat.com> In-Reply-To: <1538123582-17442-1-git-send-email-thuth@redhat.com> References: <1538123582-17442-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 28 Sep 2018 08:33:17 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This makes the code compilable with the compiler flags -Wstrict-prototypes and -Wmissing-prototypes. Signed-off-by: Thomas Huth --- x86/cmpxchg8b.c | 2 +- x86/tsc.c | 4 ++-- x86/umip.c | 6 +++--- x86/vmx.c | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/x86/cmpxchg8b.c b/x86/cmpxchg8b.c index 2e5a8e6..c56d295 100644 --- a/x86/cmpxchg8b.c +++ b/x86/cmpxchg8b.c @@ -17,7 +17,7 @@ static void test_cmpxchg8b(u32 *mem) report("cmpxchg8b", mem[0] == 3 && mem[1] == 4); } -int main() +int main(void) { setup_vm(); setup_idt(); diff --git a/x86/tsc.c b/x86/tsc.c index f841f03..6480a9c 100644 --- a/x86/tsc.c +++ b/x86/tsc.c @@ -8,7 +8,7 @@ static int check_cpuid_80000001_edx(unsigned int bit) } #define CPUID_7_0_ECX_RDPID (1 << 22) -int check_cpuid_7_0_ecx(unsigned int bit) +static int check_cpuid_7_0_ecx(unsigned int bit) { return (cpuid_indexed(7, 0).c & bit) != 0; } @@ -31,7 +31,7 @@ static void test_rdtscp(u64 aux) report("Test RDTSCP %" PRIu64, ecx == aux, aux); } -void test_rdpid(u64 aux) +static void test_rdpid(u64 aux) { u32 eax; diff --git a/x86/umip.c b/x86/umip.c index 149472d..5da6793 100644 --- a/x86/umip.c +++ b/x86/umip.c @@ -13,7 +13,7 @@ static unsigned long expected_rip; static int skip_count; static volatile int gp_count; -void gp_handler(struct ex_regs *regs) +static void gp_handler(struct ex_regs *regs) { if (regs->rip == expected_rip) { gp_count++; @@ -116,7 +116,7 @@ static void test_umip_gp(const char *msg) /* The ugly mode switching code */ -int do_ring3(void (*fn)(const char *), const char *arg) +static int do_ring3(void (*fn)(const char *), const char *arg) { static unsigned char user_stack[4096]; int ret; @@ -171,7 +171,7 @@ int do_ring3(void (*fn)(const char *), const char *arg) return ret; } -int main() +int main(void) { extern unsigned char kernel_entry; diff --git a/x86/vmx.c b/x86/vmx.c index b74ce6a..79a21d8 100644 --- a/x86/vmx.c +++ b/x86/vmx.c @@ -335,7 +335,7 @@ static bool check_all_vmcs_fields(u8 cookie) return pass; } -void test_vmwrite_vmread(void) +static void test_vmwrite_vmread(void) { struct vmcs *vmcs = alloc_page(); @@ -351,7 +351,7 @@ void test_vmwrite_vmread(void) free_page(vmcs); } -void test_vmcs_high(void) +static void test_vmcs_high(void) { struct vmcs *vmcs = alloc_page(); @@ -375,7 +375,7 @@ void test_vmcs_high(void) free_page(vmcs); } -void test_vmcs_lifecycle(void) +static void test_vmcs_lifecycle(void) { struct vmcs *vmcs[2] = {}; int i; From patchwork Fri Sep 28 08:33:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10619155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E61714BD for ; Fri, 28 Sep 2018 08:33:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90AAC28497 for ; Fri, 28 Sep 2018 08:33:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8467B2863D; Fri, 28 Sep 2018 08:33:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 043DE28497 for ; Fri, 28 Sep 2018 08:33:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729229AbeI1Oz5 (ORCPT ); Fri, 28 Sep 2018 10:55:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31367 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726971AbeI1Oz5 (ORCPT ); Fri, 28 Sep 2018 10:55:57 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 695E9308123E; Fri, 28 Sep 2018 08:33:19 +0000 (UTC) Received: from thuth.com (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3FC720155E2; Fri, 28 Sep 2018 08:33:17 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?b?UmFk?= =?utf-8?b?aW0gS3LEjW3DocWZ?= Cc: David Hildenbrand , Drew Jones , Janosch Frank Subject: [kvm-unit-tests PATCH 2/4] x86: Add missing prototypes and mark more local functions as static Date: Fri, 28 Sep 2018 10:33:00 +0200 Message-Id: <1538123582-17442-3-git-send-email-thuth@redhat.com> In-Reply-To: <1538123582-17442-1-git-send-email-thuth@redhat.com> References: <1538123582-17442-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 28 Sep 2018 08:33:19 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To be able to compile with -Wmissing-prototypes, we also need prototypes for functions that are called from assembler code. We put the prototypes into the .c files and not into header files here, since these functions are not called from other .c files. While we're at it, also mark some more functions as static in these files which are only used locally. Signed-off-by: Thomas Huth --- lib/x86/desc.c | 5 +++++ lib/x86/setup.c | 4 +++- x86/eventinj.c | 6 ++++-- x86/kvmclock.c | 11 ++++++----- x86/pku.c | 3 ++- x86/smap.c | 1 + x86/taskswitch2.c | 12 +++++++----- 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/lib/x86/desc.c b/lib/x86/desc.c index 23a0d5a..0108555 100644 --- a/lib/x86/desc.c +++ b/lib/x86/desc.c @@ -3,6 +3,11 @@ #include "processor.h" #include +#ifndef __x86_64__ +__attribute__((regparm(1))) +#endif +void do_handle_exception(struct ex_regs *regs); + void set_idt_entry(int vec, void *addr, int dpl) { idt_entry_t *e = &boot_idt[vec]; diff --git a/lib/x86/setup.c b/lib/x86/setup.c index ff7c8d3..28bbcf4 100644 --- a/lib/x86/setup.c +++ b/lib/x86/setup.c @@ -35,7 +35,9 @@ struct mbi_module { #define ENV_SIZE 16384 -extern void setup_env(char *env, int size); +void setup_env(char *env, int size); +void setup_multiboot(struct mbi_bootinfo *bootinfo); +void setup_libcflat(void); char *initrd; u32 initrd_size; diff --git a/x86/eventinj.c b/x86/eventinj.c index cbfc03f..8064eb9 100644 --- a/x86/eventinj.c +++ b/x86/eventinj.c @@ -14,17 +14,19 @@ # define R "e" #endif +void do_pf_tss(void); + static inline void io_delay(void) { } -void apic_self_ipi(u8 v) +static void apic_self_ipi(u8 v) { apic_icr_write(APIC_DEST_SELF | APIC_DEST_PHYSICAL | APIC_DM_FIXED | APIC_INT_ASSERT | v, 0); } -void apic_self_nmi(void) +static void apic_self_nmi(void) { apic_icr_write(APIC_DEST_PHYSICAL | APIC_DM_NMI | APIC_INT_ASSERT, 0); } diff --git a/x86/kvmclock.c b/x86/kvmclock.c index e7b6054..de30a5e 100644 --- a/x86/kvmclock.c +++ b/x86/kvmclock.c @@ -61,6 +61,7 @@ static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift) __rem; \ }) #else +u32 __attribute__((weak)) __div64_32(u64 *n, u32 base); u32 __attribute__((weak)) __div64_32(u64 *n, u32 base) { u64 rem = *n; @@ -121,7 +122,7 @@ u32 __attribute__((weak)) __div64_32(u64 *n, u32 base) * 0 <= tv_nsec < NSEC_PER_SEC * For negative values only the tv_sec field is negative ! */ -void set_normalized_timespec(struct timespec *ts, long sec, s64 nsec) +static void set_normalized_timespec(struct timespec *ts, long sec, s64 nsec) { while (nsec >= NSEC_PER_SEC) { /* @@ -179,7 +180,7 @@ cycle_t __pvclock_read_cycles(const struct pvclock_vcpu_time_info *src) return src->system_time + offset; } -cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) +static cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) { unsigned version; cycle_t ret; @@ -246,9 +247,9 @@ void kvm_clock_clear(void *data) wrmsr(MSR_KVM_SYSTEM_TIME_NEW, 0LL); } -void pvclock_read_wallclock(struct pvclock_wall_clock *wall_clock, - struct pvclock_vcpu_time_info *vcpu_time, - struct timespec *ts) +static void pvclock_read_wallclock(struct pvclock_wall_clock *wall_clock, + struct pvclock_vcpu_time_info *vcpu_time, + struct timespec *ts) { u32 version; u64 delta; diff --git a/x86/pku.c b/x86/pku.c index d51d26f..3d7c5cd 100644 --- a/x86/pku.c +++ b/x86/pku.c @@ -14,7 +14,7 @@ volatile int pf_count = 0; volatile unsigned save; volatile unsigned test; -void set_cr0_wp(int wp) +static void set_cr0_wp(int wp) { unsigned long cr0 = read_cr0(); @@ -24,6 +24,7 @@ void set_cr0_wp(int wp) write_cr0(cr0); } +void do_pf_tss(unsigned long error_code); void do_pf_tss(unsigned long error_code) { pf_count++; diff --git a/x86/smap.c b/x86/smap.c index f316c14..afa3644 100644 --- a/x86/smap.c +++ b/x86/smap.c @@ -9,6 +9,7 @@ volatile int pf_count = 0; volatile int save; volatile unsigned test; +void do_pf_tss(unsigned long error_code); // When doing ring 3 tests, page fault handlers will always run on a // separate stack (the ring 0 stack). Seems easier to use the alt_stack diff --git a/x86/taskswitch2.c b/x86/taskswitch2.c index 8714ade..62f0ead 100644 --- a/x86/taskswitch2.c +++ b/x86/taskswitch2.c @@ -17,6 +17,8 @@ static volatile unsigned int test_divider; static char *fault_addr; static ulong fault_phys; +void do_pf_tss(ulong *error_code); + static inline void io_delay(void) { } @@ -115,7 +117,7 @@ start: goto start; } -void test_kernel_mode_int() +static void test_kernel_mode_int(void) { unsigned int res; @@ -193,7 +195,7 @@ void test_kernel_mode_int() report("PF exeption", test_count == 1); } -void test_gdt_task_gate(void) +static void test_gdt_task_gate(void) { /* test that calling a task by lcall works */ test_count = 0; @@ -219,7 +221,7 @@ void test_gdt_task_gate(void) report("ljmp", test_count == 1); } -void test_vm86_switch(void) +static void test_vm86_switch(void) { static tss32_t main_tss; static tss32_t vm86_tss; @@ -266,7 +268,7 @@ void test_vm86_switch(void) #define IOPL_SHIFT 12 -void test_conforming_switch(void) +static void test_conforming_switch(void) { /* test lcall with conforming segment, cs.dpl != cs.rpl */ test_count = 0; @@ -281,7 +283,7 @@ void test_conforming_switch(void) report("lcall with cs.rpl != cs.dpl", test_count == 1); } -int main() +int main(void) { setup_vm(); setup_idt(); From patchwork Fri Sep 28 08:33:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10619157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 689FB174A for ; Fri, 28 Sep 2018 08:33:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C10428497 for ; Fri, 28 Sep 2018 08:33:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 508D52863D; Fri, 28 Sep 2018 08:33:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0200928497 for ; Fri, 28 Sep 2018 08:33:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729234AbeI1Oz7 (ORCPT ); Fri, 28 Sep 2018 10:55:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58988 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729227AbeI1Oz7 (ORCPT ); Fri, 28 Sep 2018 10:55:59 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 74904308427D; Fri, 28 Sep 2018 08:33:21 +0000 (UTC) Received: from thuth.com (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF65220155E2; Fri, 28 Sep 2018 08:33:19 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?b?UmFk?= =?utf-8?b?aW0gS3LEjW3DocWZ?= Cc: David Hildenbrand , Drew Jones , Janosch Frank Subject: [kvm-unit-tests PATCH 3/4] s390x: Make code compilable with -Wmissing-prototypes and -Wstrict-prototypes Date: Fri, 28 Sep 2018 10:33:01 +0200 Message-Id: <1538123582-17442-4-git-send-email-thuth@redhat.com> In-Reply-To: <1538123582-17442-1-git-send-email-thuth@redhat.com> References: <1538123582-17442-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 28 Sep 2018 08:33:21 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Include the right header in mmu.c to make sure that the implementations match the prototypes, and avoid old-style declaration in float.h. Signed-off-by: Thomas Huth Reviewed-by: David Hildenbrand --- lib/s390x/asm/float.h | 2 +- lib/s390x/mmu.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/s390x/asm/float.h b/lib/s390x/asm/float.h index e994e15..f61fa62 100644 --- a/lib/s390x/asm/float.h +++ b/lib/s390x/asm/float.h @@ -24,7 +24,7 @@ static inline uint32_t get_fpc(void) return fpc; } -static inline uint8_t get_fpc_dxc() +static inline uint8_t get_fpc_dxc(void) { return get_fpc() >> 8; } diff --git a/lib/s390x/mmu.c b/lib/s390x/mmu.c index 70753c3..912236c 100644 --- a/lib/s390x/mmu.c +++ b/lib/s390x/mmu.c @@ -15,6 +15,7 @@ #include #include #include +#include "mmu.h" static pgd_t *table_root; From patchwork Fri Sep 28 08:33:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10619159 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2FF46174A for ; Fri, 28 Sep 2018 08:33:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22B1128497 for ; Fri, 28 Sep 2018 08:33:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 174692863D; Fri, 28 Sep 2018 08:33:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C707A28497 for ; Fri, 28 Sep 2018 08:33:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729242AbeI1O4B (ORCPT ); Fri, 28 Sep 2018 10:56:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729232AbeI1O4B (ORCPT ); Fri, 28 Sep 2018 10:56:01 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7FB25368E7; Fri, 28 Sep 2018 08:33:23 +0000 (UTC) Received: from thuth.com (ovpn-116-58.ams2.redhat.com [10.36.116.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBEDB20155E2; Fri, 28 Sep 2018 08:33:21 +0000 (UTC) From: Thomas Huth To: kvm@vger.kernel.org, Paolo Bonzini , =?utf-8?b?UmFk?= =?utf-8?b?aW0gS3LEjW3DocWZ?= Cc: David Hildenbrand , Drew Jones , Janosch Frank Subject: [kvm-unit-tests PATCH 4/4] Makefile: Compile with -Wmissing-prototypes and -Wstrict-prototypes Date: Fri, 28 Sep 2018 10:33:02 +0200 Message-Id: <1538123582-17442-5-git-send-email-thuth@redhat.com> In-Reply-To: <1538123582-17442-1-git-send-email-thuth@redhat.com> References: <1538123582-17442-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 28 Sep 2018 08:33:23 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With these compiler flags, we can be sure that the implementation really matches the prototypes in the headers. Signed-off-by: Thomas Huth Acked-by: David Hildenbrand --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 7c0f8e2..e9f0227 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,7 @@ cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ COMMON_CFLAGS += -g $(autodepend-flags) COMMON_CFLAGS += -Wall -Wwrite-strings -Wclobbered -Wempty-body -Wuninitialized COMMON_CFLAGS += -Wignored-qualifiers -Wunused-but-set-parameter +COMMON_CFLAGS += -Wmissing-prototypes -Wstrict-prototypes COMMON_CFLAGS += -Werror frame-pointer-flag=-f$(if $(KEEP_FRAME_POINTER),no-,)omit-frame-pointer fomit_frame_pointer := $(call cc-option, $(frame-pointer-flag), "")