Added macros to follow format string checking through wrappers
This commit is contained in:
parent
bb4b35e438
commit
53faac10c5
@ -38,6 +38,8 @@
|
|||||||
// No alignment needed in MSVC
|
// No alignment needed in MSVC
|
||||||
#define ALIGN_8
|
#define ALIGN_8
|
||||||
#define ALIGN_16
|
#define ALIGN_16
|
||||||
|
|
||||||
|
#define FORMATSTRING(formatIndex,va_argsIndex)
|
||||||
|
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
|
|
||||||
@ -56,6 +58,8 @@
|
|||||||
|
|
||||||
// Some portability macros :)
|
// Some portability macros :)
|
||||||
#define stricmp strcasecmp
|
#define stricmp strcasecmp
|
||||||
|
|
||||||
|
#define FORMATSTRING(formatIndex,va_argsIndex) __attribute__((format (printf, formatIndex, va_argsIndex)))
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ public:
|
|||||||
/** Returns the list of all items in the specified folder (files, folders, nix pipes, whatever's there). */
|
/** Returns the list of all items in the specified folder (files, folders, nix pipes, whatever's there). */
|
||||||
static AStringVector GetFolderContents(const AString & a_Folder); // Exported in ManualBindings.cpp
|
static AStringVector GetFolderContents(const AString & a_Folder); // Exported in ManualBindings.cpp
|
||||||
|
|
||||||
int Printf(const char * a_Fmt, ...);
|
int Printf(const char * a_Fmt, ...) FORMATSTRING(2,3);
|
||||||
|
|
||||||
/** Flushes all the bufferef output into the file (only when writing) */
|
/** Flushes all the bufferef output into the file (only when writing) */
|
||||||
void Flush(void);
|
void Flush(void);
|
||||||
|
@ -22,13 +22,13 @@ typedef std::list<AString> AStringList;
|
|||||||
|
|
||||||
|
|
||||||
/** Add the formated string to the existing data in the string */
|
/** Add the formated string to the existing data in the string */
|
||||||
extern AString & AppendVPrintf(AString & str, const char * format, va_list args);
|
extern AString & AppendVPrintf(AString & str, const char * format, va_list args) FORMATSTRING(2,0);
|
||||||
|
|
||||||
/// Output the formatted text into the string
|
/// Output the formatted text into the string
|
||||||
extern AString & Printf (AString & str, const char * format, ...);
|
extern AString & Printf (AString & str, const char * format, ...) FORMATSTRING(2,3);
|
||||||
|
|
||||||
/// Output the formatted text into string, return string by value
|
/// Output the formatted text into string, return string by value
|
||||||
extern AString Printf(const char * format, ...);
|
extern AString Printf(const char * format, ...) FORMATSTRING(1,2);
|
||||||
|
|
||||||
/// Add the formatted string to the existing data in the string
|
/// Add the formatted string to the existing data in the string
|
||||||
extern AString & AppendPrintf (AString & str, const char * format, ...);
|
extern AString & AppendPrintf (AString & str, const char * format, ...);
|
||||||
|
Loading…
Reference in New Issue
Block a user