Hacker News new | ask | show | jobs
by omoikane 7 days ago
> P0085R5 “Oo… adding a coherent character sequence to begin octal-literals”

Deprecating 0-prefix octal literals is probably setting up many popular repositories for cleanup churn.

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p00...

Seems like if a piece of code wants to compile free of diagnostics before and after C++29, it will need to avoid octal literals altogether, or maybe select the octal literal based on `__cplusplus` version, both seem ugly.

1 comments

How many C++ programs, particularly ones looking to be compiled with a modern compiler, use octal literals? I’ve personally never seen them used in my 20 years of using C++. Maybe something dealing with Unix file permissions?
I have seen them, but it was mostly using leading 0 to align numbers, not realizing it was octal.
They have a few examples linked from the page above, and it's basically permissions and file stats, e.g. "IFMT = 00170000", "#define S_IRUSR 0000400", that kind of thing.