Skip to content

#fmt accepts some combinations of precision and 0 padding that gcc warns about #2481

Closed
@brson

Description

@brson

This is one of the tests in syntax-extension-fmt.rs:

printf("%06.5x\n", 127);

In this case the zero-padding overrides the precision (.5) so precision has no effect. Old gcc's accepted this silently, so we do too, but gcc 4.5 (at least) prints a warning about zero-padding and precision being incompatible here, so we should make this (and similar) cases into compile time errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions