diff options
| author | meme <meme@users.noreply.github.com> | 2019-10-09 20:15:28 -0400 |
|---|---|---|
| committer | Jordan <jordan@psifertex.com> | 2019-10-16 14:32:01 -0400 |
| commit | ae342d63609b706fe2b0d58695c3ae2043f4667c (patch) | |
| tree | a0fc9499dd99453495a4c935b84a4ff228a4152b | |
| parent | dc5e614df6d150ef8bfae6d65fd82d45623aa8b6 (diff) | |
Add `printf` annotation
| -rw-r--r-- | binaryninjaapi.h | 18 | ||||
| -rw-r--r-- | binaryninjacore.h | 23 |
2 files changed, 41 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 1728774d..a1233412 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -585,6 +585,9 @@ namespace BinaryNinja \param fmt C-style format string. \param ... Variable arguments corresponding to the format string. */ +#ifdef __GNUC__ + __attribute__ ((format (printf, 2, 3))) +#endif void Log(BNLogLevel level, const char* fmt, ...); /*! LogDebug only writes text to the error console if the console is set to log level: DebugLog @@ -593,6 +596,9 @@ namespace BinaryNinja \param fmt C-style format string. \param ... Variable arguments corresponding to the format string. */ +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif void LogDebug(const char* fmt, ...); /*! LogInfo always writes text to the error console, and corresponds to the log level: InfoLog. @@ -601,6 +607,9 @@ namespace BinaryNinja \param fmt C-style format string. \param ... Variable arguments corresponding to the format string. */ +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif void LogInfo(const char* fmt, ...); /*! LogWarn writes text to the error console including a warning icon, @@ -609,6 +618,9 @@ namespace BinaryNinja \param fmt C-style format string. \param ... Variable arguments corresponding to the format string. */ +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif void LogWarn(const char* fmt, ...); /*! LogError writes text to the error console and pops up the error console. Additionall, @@ -617,6 +629,9 @@ namespace BinaryNinja \param fmt C-style format string. \param ... Variable arguments corresponding to the format string. */ +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif void LogError(const char* fmt, ...); /*! LogAlert pops up a message box displaying the alert message and logs to the error console. @@ -625,6 +640,9 @@ namespace BinaryNinja \param fmt C-style format string. \param ... Variable arguments corresponding to the format string. */ +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif void LogAlert(const char* fmt, ...); void LogToStdout(BNLogLevel minimumLevel); diff --git a/binaryninjacore.h b/binaryninjacore.h index ada6c81e..a9dae964 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -2103,11 +2103,34 @@ extern "C" BINARYNINJACOREAPI void BNAddOptionalPluginDependency(const char* name); // Logging +#ifdef __GNUC__ +__attribute__ ((format (printf, 2, 3))) +#endif BINARYNINJACOREAPI void BNLog(BNLogLevel level, const char* fmt, ...); + +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif BINARYNINJACOREAPI void BNLogDebug(const char* fmt, ...); + +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif BINARYNINJACOREAPI void BNLogInfo(const char* fmt, ...); + +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif BINARYNINJACOREAPI void BNLogWarn(const char* fmt, ...); + +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif BINARYNINJACOREAPI void BNLogError(const char* fmt, ...); + +#ifdef __GNUC__ +__attribute__ ((format (printf, 1, 2))) +#endif BINARYNINJACOREAPI void BNLogAlert(const char* fmt, ...); BINARYNINJACOREAPI void BNRegisterLogListener(BNLogListener* listener); |
