A leading-zero literal reads as decimal #65

Closed
opened 2026-10-09 15:18:43 +02:00 by alex-eg · 1 comment
Owner

0755 reads as 755, while C reads it as octal 493. With 0x/0b now accepted (#47), C-style spelling looks supported, so a C programmer writing an octal literal gets a different value and no warning.

Expected: an error at the literal, pointing to #o755. 0 itself, and 0.5-style decimals, stay valid.


Found while fixing #47.

`0755` reads as 755, while C reads it as octal 493. With `0x`/`0b` now accepted (#47), C-style spelling looks supported, so a C programmer writing an octal literal gets a different value and no warning. Expected: an error at the literal, pointing to `#o755`. `0` itself, and `0.5`-style decimals, stay valid. -------- Found while fixing #47.
alex-eg added the bug label 2026-10-09 15:18:43 +02:00
Author
Owner

Fixed by 9505b4f.

Fixed by 9505b4f.
Sign in to join this conversation.