From d440c3f50a918a932293ad98bcec96eaa4683222 Mon Sep 17 00:00:00 2001 From: Pixel Date: Sun, 4 Dec 2011 01:19:09 -0800 Subject: Reworked some things in the architecture, mainly exceptions and asserts. -) Removed Assert() -) Added AAssert(), IAssert(), RAssert(), TAssert() and Failure() -) Reworked all asserts in the code, and added meaningful messages to them. -) Changed the way the startup code is generated; BALAU_STARTUP is no longer necessary. --- includes/BString.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'includes/BString.h') diff --git a/includes/BString.h b/includes/BString.h index d8487d0..29f3d22 100644 --- a/includes/BString.h +++ b/includes/BString.h @@ -26,12 +26,12 @@ class String : private std::string { String(const String & s) : std::string(s) { } String(const std::string & s) : std::string(s) { } - String & set(const char * fmt, va_list); - String & set(const char * fmt, ...) { va_list ap; va_start(ap, fmt); set(fmt, ap); va_end(ap); return *this; } + String & set(const char * fmt, va_list) __attribute__((format(printf, 2, 0))); + String & set(const char * fmt, ...) __attribute__((format(printf, 2, 3))) { va_list ap; va_start(ap, fmt); set(fmt, ap); va_end(ap); return *this; } String & set(const String & fmt, ...) { va_list ap; va_start(ap, fmt); set(fmt.to_charp(), ap); va_end(ap); return *this; } int scanf(const char * fmt, va_list ap) const { return ::vsscanf(c_str(), fmt, ap); } - int scanf(const char * fmt, ...) const { va_list ap; va_start(ap, fmt); int r = scanf(fmt, ap); va_end(ap); return r; } + int scanf(const char * fmt, ...) const __attribute__((format(scanf, 2, 3))) { va_list ap; va_start(ap, fmt); int r = scanf(fmt, ap); va_end(ap); return r; } int scanf(const String & fmt, ...) const { va_list ap; va_start(ap, fmt); int r = scanf(fmt.to_charp(), ap); va_end(ap); return r; } const char * to_charp(size_t begin = 0) const { return c_str() + begin; } -- cgit v1.2.3