Skip to content
Snippets Groups Projects
  • Simon Tatham's avatar
    cbfba7a0
    Greatly improve printf format-string checking. · cbfba7a0
    Simon Tatham authored
    I've added the gcc-style attribute("printf") to a lot of printf-shaped
    functions in this code base that didn't have it. To make that easier,
    I moved the wrapping macro into defs.h, and also enabled it if we
    detect the __clang__ macro as well as __GNU__ (hence, it will be used
    when building for Windows using clang-cl).
    
    The result is that a great many format strings in the code are now
    checked by the compiler, where they were previously not. This causes
    build failures, which I'll fix in the next commit.
    cbfba7a0
    History
    Greatly improve printf format-string checking.
    Simon Tatham authored
    I've added the gcc-style attribute("printf") to a lot of printf-shaped
    functions in this code base that didn't have it. To make that easier,
    I moved the wrapping macro into defs.h, and also enabled it if we
    detect the __clang__ macro as well as __GNU__ (hence, it will be used
    when building for Windows using clang-cl).
    
    The result is that a great many format strings in the code are now
    checked by the compiler, where they were previously not. This causes
    build failures, which I'll fix in the next commit.