--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposal...@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
I'd love to have a way to express octal literals in a more obvious way than with a leading 0 (as rare as octals are in my code). Jens
On 2015–06–26, at 12:51 PM, Olaf van der Spek <olafv...@gmail.com> wrote:2015-06-24 20:35 GMT+02:00 Tony V E <tvan...@gmail.com>:Deprecating 0 just isn't going to happen, I think.
Compiler warnings might be a good start.
People just don't expect 010 == 8 to be true.
Unfortunately, it looks like the octal constants went from "File mode bits and the contents of the remaining members of the stat structure are unspecified,” in POSIX:2004 <http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/stat.h.html>, to "The /<sys/stat.h>/ header shall define the following symbolic constants for the file mode bits encoded in type mode_t, with the indicated numeric values,” in POSIX:2013 <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html>. There might have been a window in the C++03 timeframe when deprecation of octal would have encouraged users to conform to POSIX, but now the tables have turned.
Well, you're still encourage to use the symbolic constants, rights?
If 0o is available the system header could use it and no pragmas would
be necessary, right?
2015-06-24 20:35 GMT+02:00 Tony V E <tvan...@gmail.com>:
> Deprecating 0 just isn't going to happen, I think.
Compiler warnings might be a good start.
People just don't expect 010 == 8 to be true.
Example: on Linux, constants like O_RDWR actually come from a kernel header
and are defined in octal. So even if you updated your compiler and you updated
your libc, those constants would still "leak" to your code.
Compilers are already good at not warning on things in system headers.
I wouldn't worry about that.
On 2015–07–02, at 9:43 AM, Thiago Macieira <thi...@macieira.org> wrote:* a lot of \ooo escapes in strings, especially \0, followed by \1, \01, \001,
\033 and \377
* comparisons to octal macros, like:
# if __HP_aCC-0 < 060000
#if (__HP_aCC >= 60000) || ((__HP_aCC > 38000) && defined(__hpxstd98))
On 2015–07–02, at 9:43 AM, Thiago Macieira <thi...@macieira.org> wrote:* a lot of \ooo escapes in strings, especially \0, followed by \1, \01, \001,
\033 and \377String and character literals are an entirely different topic from integer literals.Actually, they could be used as a migration path. L'\644' is a valid third argument to open(2) unless sizeof(wchar_t) > sizeof(int). '\360' is a more straightforward version of char(0360) which you found.* comparisons to octal macros, like:
# if __HP_aCC-0 < 060000This appears to be in error. Boost, at least, treats __HP_aCC as a decimal literal:#if (__HP_aCC >= 60000) || ((__HP_aCC > 38000) && defined(__hpxstd98))This also mentions a prior version A.03.80, which couldn’t have been encoded in octal at all. Your quote includes a useless “-0” which looks vaguely like a superstitious octal-banishing incantation. I'm inclined to believe Boost here.
On 2015–07–02, at 2:04 PM, Thiago Macieira <thi...@macieira.org> wrote:The problem is that the file permissions are *everywhere* due to "everything is
a file" and virtual filesystem support.
We could convince people that the uapi
headers should be fixed[*], but asking to change anything else is going to hit
a wall until a solution is found for file permissions.
On Wed, Jul 1, 2015 at 8:02 PM, David Krauss <pot...@gmail.com> wrote:On 2015–07–02, at 9:43 AM, Thiago Macieira <thi...@macieira.org> wrote:
* a lot of \ooo escapes in strings, especially \0, followed by \1, \01, \001,
\033 and \377
String and character literals are an entirely different topic from integer literals.
Actually, they could be used as a migration path. L'\644' is a valid third argument to open(2) unless sizeof(wchar_t) > sizeof(int). '\360' is a more straightforward version of char(0360) which you found.
* comparisons to octal macros, like:
# if __HP_aCC-0 < 060000
This appears to be in error. Boost, at least, treats __HP_aCC as a decimal literal:
#if (__HP_aCC >= 60000) || ((__HP_aCC > 38000) && defined(__hpxstd98))
This also mentions a prior version A.03.80, which couldn’t have been encoded in octal at all. Your quote includes a useless “-0” which looks vaguely like a superstitious octal-banishing incantation. I'm inclined to believe Boost here.
I believe "-0" is an incantation to deal with the situation where __HP_aCC is #defined as the empty string.If it expands to empty-string, then indeed (-0 < 060000) is true, instead of being a syntax error.However, I think you're right that this octal was unintended.
–Arthur
--
---
You received this message because you are subscribed to a topic in the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this topic, visit https://groups.google.com/a/isocpp.org/d/topic/std-proposals/IXXXDo3Y1rA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to std-proposal...@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.