www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Deprecation in core.sys.posix.termios

reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
Due to the deprecation of octal literals, core.sys.posix.termios doesn't
compile anymore. But because this is in druntime, we can't use
std.conv.octal. What should be done about this?


T

-- 
Designer clothes: how to cover less by paying more.
Nov 16 2012
parent reply =?ISO-8859-1?Q?Alex_R=F8nne_Petersen?= <alex lycus.org> writes:
On 16-11-2012 19:14, H. S. Teoh wrote:
 Due to the deprecation of octal literals, core.sys.posix.termios doesn't
 compile anymore. But because this is in druntime, we can't use
 std.conv.octal. What should be done about this?


 T
I fixed this in a pull request of mine because it happened to get in my way too: https://github.com/D-Programming-Language/druntime/pull/340 (I really wish someone would review/merge that pull request.) Generally, we just turn octal literals into hex literals in druntime (and write the octal number in a comment if necessary). -- Alex Rønne Petersen alex lycus.org http://lycus.org
Nov 16 2012
next sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Fri, Nov 16, 2012 at 07:15:01PM +0100, Alex Rønne Petersen wrote:
 On 16-11-2012 19:14, H. S. Teoh wrote:
Due to the deprecation of octal literals, core.sys.posix.termios doesn't
compile anymore. But because this is in druntime, we can't use
std.conv.octal. What should be done about this?


T
I fixed this in a pull request of mine because it happened to get in my way too: https://github.com/D-Programming-Language/druntime/pull/340 (I really wish someone would review/merge that pull request.)
Yeah somebody please merge that pull request!
 Generally, we just turn octal literals into hex literals in druntime
 (and write the octal number in a comment if necessary).
[...] On another note, I love vim/perl 1-liners: '<,'>!perl -pe's/\b(0\d+)/sprintf("0x\%04x", oct $1)/eg;' Automatically converts all octal literals into 4-digit padded hex literals in selection. :-) T -- IBM = I Blame Microsoft
Nov 16 2012
prev sibling parent reply "angel" <andrey.gelman gmail.com> writes:
Converting octal to hexadecimal is kinda ugly, as _everyone_ 
knows / remembers these constants as octal.
Possibly 'octal!' should be defined in druntime ?
By the way, did you look for other occurences of octal numbers, 
termios is surely not the only place ?
Nov 18 2012
parent =?UTF-8?B?QWxleCBSw7hubmUgUGV0ZXJzZW4=?= <alex lycus.org> writes:
On 18-11-2012 20:15, angel wrote:
 Converting octal to hexadecimal is kinda ugly, as _everyone_ knows /
 remembers these constants as octal.
 Possibly 'octal!' should be defined in druntime ?
 By the way, did you look for other occurences of octal numbers, termios
 is surely not the only place ?
The only people who need to care are druntime maintainers, and we get by fine with hexadecimal numbers so far. I wouldn't be worried. And yes, I did get rid of all octal literals in my pull request, at least to the point where things compile. -- Alex Rønne Petersen alex lycus.org http://lycus.org
Nov 18 2012