diff --git a/include/arch/arm/arch/stdint.h b/include/arch/arm/arch/stdint.h deleted file mode 100644 index 0cb54c4aa..000000000 --- a/include/arch/arm/arch/stdint.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2014, General Dynamics C4 Systems - * - * This software may be distributed and modified according to the terms of - * the GNU General Public License version 2. Note that NO WARRANTY is provided. - * See "LICENSE_GPLv2.txt" for details. - * - * @TAG(GD_GPL) - */ - -#ifndef __ARCH_STDINT_H -#define __ARCH_STDINT_H - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned long uint32_t; -typedef unsigned long long uint64_t; - -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed long int32_t; - -#endif diff --git a/include/arch/x86/arch/stdint.h b/include/arch/x86/arch/stdint.h deleted file mode 100644 index 293fedc4e..000000000 --- a/include/arch/x86/arch/stdint.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2014, General Dynamics C4 Systems - * - * This software may be distributed and modified according to the terms of - * the GNU General Public License version 2. Note that NO WARRANTY is provided. - * See "LICENSE_GPLv2.txt" for details. - * - * @TAG(GD_GPL) - */ - -#ifndef __ARCH_STDINT_H -#define __ARCH_STDINT_H - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; - -typedef signed char int8_t; -typedef signed short int16_t; -typedef signed int int32_t; -typedef signed long long int64_t; - -#endif diff --git a/include/machine/io.h b/include/machine/io.h index e98d99649..1d4f64164 100644 --- a/include/machine/io.h +++ b/include/machine/io.h @@ -15,11 +15,14 @@ #include #include +#define FORMAT(archetype, string_index, first_to_check) \ + __attribute__((format(archetype, string_index, first_to_check))) + #if defined DEBUG || defined RELEASE_PRINTF unsigned int puts(const char *s) VISIBLE; /* for prints that you want enabled in both DEBUG and RELEASE_PRINTF modes, use kprintf directly */ -unsigned int kprintf(const char *format, ...) VISIBLE; +unsigned int kprintf(const char *format, ...) VISIBLE FORMAT(printf, 1, 2); unsigned int print_unsigned_long(unsigned long x, unsigned int ui_base) VISIBLE; #endif diff --git a/include/stdint.h b/include/stdint.h index 465ba9953..481f08dad 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -11,6 +11,14 @@ #ifndef __STDINT_H #define __STDINT_H -#include +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned long uint32_t; +typedef unsigned long long uint64_t; + +typedef signed char int8_t; +typedef signed short int16_t; +typedef signed long int32_t; +typedef signed long long int64_t; #endif diff --git a/src/arch/x86/kernel/boot_sys.c b/src/arch/x86/kernel/boot_sys.c index 229ff9256..7ac9eff78 100644 --- a/src/arch/x86/kernel/boot_sys.c +++ b/src/arch/x86/kernel/boot_sys.c @@ -561,7 +561,7 @@ try_boot_sys( modules[i].start, modules[i].end, modules[i].end - modules[i].start, - modules[i].name + (char *) modules[i].name ); if ((int32_t)(modules[i].end - modules[i].start) <= 0) { printf("Invalid boot module size! Possible cause: boot module file not found by QEMU\n"); diff --git a/src/object/interrupt.c b/src/object/interrupt.c index 1ac510299..4ee150111 100644 --- a/src/object/interrupt.c +++ b/src/object/interrupt.c @@ -135,7 +135,7 @@ decodeIRQHandlerInvocation(word_t label, unsigned int length, irq_t irq, bool_t trig, pol; if (length < 2) { - userError("IRQSetMode: Not enough arguments", length); + userError("IRQSetMode: Not enough arguments: %d", length); current_syscall_error.type = seL4_TruncatedMessage; return EXCEPTION_SYSCALL_ERROR; } diff --git a/src/object/objecttype.c b/src/object/objecttype.c index f12aeb484..d004dd0c5 100644 --- a/src/object/objecttype.c +++ b/src/object/objecttype.c @@ -599,20 +599,20 @@ decodeInvocation(word_t label, unsigned int length, switch (cap_get_capType(cap)) { case cap_null_cap: - userError("Attempted to invoke a null cap #%u.", capIndex); + userError("Attempted to invoke a null cap #%lu.", capIndex); current_syscall_error.type = seL4_InvalidCapability; current_syscall_error.invalidCapNumber = 0; return EXCEPTION_SYSCALL_ERROR; case cap_zombie_cap: - userError("Attempted to invoke a zombie cap #%u.", capIndex); + userError("Attempted to invoke a zombie cap #%lu.", capIndex); current_syscall_error.type = seL4_InvalidCapability; current_syscall_error.invalidCapNumber = 0; return EXCEPTION_SYSCALL_ERROR; case cap_endpoint_cap: if (unlikely(!cap_endpoint_cap_get_capCanSend(cap))) { - userError("Attempted to invoke a read-only endpoint cap #%u.", + userError("Attempted to invoke a read-only endpoint cap #%lu.", capIndex); current_syscall_error.type = seL4_InvalidCapability; current_syscall_error.invalidCapNumber = 0; @@ -629,7 +629,7 @@ decodeInvocation(word_t label, unsigned int length, word_t msg; if (unlikely(!cap_async_endpoint_cap_get_capAEPCanSend(cap))) { - userError("Attempted to invoke a read-only async-endpoint cap #%u.", + userError("Attempted to invoke a read-only async-endpoint cap #%lu.", capIndex); current_syscall_error.type = seL4_InvalidCapability; current_syscall_error.invalidCapNumber = 0; @@ -650,7 +650,7 @@ decodeInvocation(word_t label, unsigned int length, case cap_reply_cap: if (unlikely(cap_reply_cap_get_capReplyMaster(cap))) { - userError("Attempted to invoke an invalid reply cap #%u.", + userError("Attempted to invoke an invalid reply cap #%lu.", capIndex); current_syscall_error.type = seL4_InvalidCapability; current_syscall_error.invalidCapNumber = 0; diff --git a/src/object/tcb.c b/src/object/tcb.c index cfe5f776d..b07204ebc 100644 --- a/src/object/tcb.c +++ b/src/object/tcb.c @@ -734,7 +734,7 @@ decodeDomainInvocation(word_t label, unsigned int length, extra_caps_t extraCaps } else { domain = getSyscallArg(0, buffer); if (domain >= CONFIG_NUM_DOMAINS) { - userError("Domain Configure: invalid domain (%u >= %u).", + userError("Domain Configure: invalid domain (%lu >= %u).", domain, CONFIG_NUM_DOMAINS); current_syscall_error.type = seL4_InvalidArgument; current_syscall_error.invalidArgumentNumber = 0;