Skip to content

[feature request] custom printf format specifiers #127208

Open
@olemayu

Description

This would enable custom printf implementations to do more and also be able to rely on -Wformat or -Werror=format flag.

Here's initial suggestion:

/* "int" types would implicitly also define "%lb", "%llb" and "%zb" */
#pragma clang format "%b" "int"

typedef struct string_s {
    char* buf;
    size_t size;
} string_t;

/* override */
#pragma clang format "%s" "string_t"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions