Skip to content

Mark the variadic *printf functions with __attribute__((format)). #79

@svkampen

Description

@svkampen

The format attribute marks a variadic function as taking a format string and corresponding arguments which should be type-checked against the format string. Marking printf_, sprintf_, etc. this way allows compilers to issue warnings when the supplied arguments do not have the correct type, as they would for the standard library functions.

The code change is very small, and currently implemented in svkampen@ba025a5 svkampen@d8aeaa9 (see comments below). I've guarded the __attribute__ declarations with #ifdef __GNUC__ ... #endif, so that they don't interfere with compilers that don't support them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions