Skip to content

FORMAT_STRING

FORMAT_STRING

Description

Enables printf-style format string validation for non-MSVC compilers.

Parameters

Name Direction Description
fmt_pos in Position of format string parameter (1-based)
va_arg_pos in Position of variadic arguments (1-based)

Success

Enables compiler format string validation (GCC/Clang).

Failure

No-op when using MSVC compiler.

Usage example (Cross-references)

Usage examples (Cross-references)
    
    #if defined(_MSC_VER) || defined(__MSC_VER)
    #    define FORMAT_STRING(fmt_pos, va_arg_pos)
    #else
    ///
        /// FAILURE : NULL
        ///
        Str *StrPrintf(Str *str, const char *fmt, ...) FORMAT_STRING(2, 3);
    
    #ifdef __cplusplus
        /// FAILURE : NULL
        ///
        Str *StrAppendf(Str *str, const char *fmt, ...) FORMAT_STRING(2, 3);
    
    #ifdef __cplusplus
Last updated on