Skip to content

Unexpected -std=c2y octal warnings on zero with type suffix #149669

@dzaima

Description

@dzaima

The C code long long foo = 0ll;, compiled with -std=c2y, gives:

<source>:1:17: warning: octal literals without a '0o' prefix are deprecated [-Wdeprecated-octal-literals]
    1 | long long foo = 0ll;
      |                 ^

but should not. (same with 0u, 0l, 0ul, 0ull)

https://godbolt.org/z/YKoWs9brM
(from a discussion on Discord)

Metadata

Metadata

Assignees

No one assigned

    Labels

    c2yclang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions