2 ms·
You could even support binary that way: 0b10101101 If you standardize this the leading zero becomes somewhat unnecessary. But of course it's probably too lat
by jandrese 8y ago
You could even support binary that way:
0b10101101
If you standardize this the leading zero becomes somewhat unnecessary. But of course it's probably too late for C. You would have to depreciate the old notation for decades before it could be removed.
- kazinator 8y agoDeprecating is as simple as emitting a diagnostic whenever it occurs, rate-limited to once per translation unit, say.
- jandrese 8y agoYes, but it also means fixing all of that old code before you can turn the depreciation into full on removal. It would be interesting to note that such warnings would undoubtedly point out a few errors in existing code where people 0 padded a number they expected to be decimal. Many would be harmless, 00001 for example, but a few could have been causing unintended side effects (incorrect initialization values for example).
- steveklabnik 8y ago(As I mentioned above, Rust does exactly this; 0o for octal, 0b for binary.)