digitalmars.D - TDPL error(s)
- Timon Gehr (10/10) May 08 2011 On page 263, TDPL states that struct objects nested inside a function ca...
- Denis Koroskin (13/26) May 08 2011 Without looking at the code, I'd assume that Local is defined something ...
- Timon Gehr (2/23) May 08 2011 I see. After further reading, the alignment of structs is indeed explain...
- dolive (2/40) May 08 2011 Why ddmd don‘t continue ? Give up ?
- Andrei Alexandrescu (4/13) May 08 2011 Thanks, added to the errata: http://erdani.com/tdpl/errata
- Nick Sabalausky (6/7) May 08 2011 Speaking of errata related to TDPL, I'm getting this in FF and IE:
- Andrei Alexandrescu (3/12) May 08 2011 Thanks, I'll look into it. What version of FF and what OS?
- Nick Sabalausky (5/22) May 08 2011 Heh, uh, well, FF2 ;) And IE7 (I like to keep IE at 7 so I can test my s...
- Andrej Mitrovic (4/4) May 08 2011 What the heck.. scrolling through this new layout completely maxes out
On page 263, TDPL states that struct objects nested inside a function cannot be returned, because the caller does not have access to their types. Using the auto keyword, DMD lets you do this though. Is this a bug in DMD or an error in TDPL? On the same page, the assert should be assert(Local.sizeof == size_t.sizeof + int.sizeof); rather than assert(Local.sizeof == 2*size_t.sizeof); which always fails in 64 bit. Timon
May 08 2011
On Sun, 08 May 2011 17:59:02 +0400, Timon Gehr <timon.gehr gmx.ch> wrote:On page 263, TDPL states that struct objects nested inside a function cannot be returned, because the caller does not have access to their types. Using the auto keyword, DMD lets you do this though. Is this a bug in DMD or an error in TDPL?I think that's fine.On the same page, the assert should be assert(Local.sizeof == size_t.sizeof + int.sizeof); rather than assert(Local.sizeof == 2*size_t.sizeof); which always fails in 64 bit. TimonWithout looking at the code, I'd assume that Local is defined something like this: struct Local { size_t s; int i; } in which case Local.sizeof would most likely be size_t.sizeof * 2 because of the alignment and implicit padding, i.e 8 bytes on x86, and 16 bytes on x64. size_t.sizeof + int.sizeof only give 12. I'd agree that this is in fact confusing and needs to be explained.
May 08 2011
On Sun, 08 May 2011 17:59:02 +0400, Timon Gehr <timon.gehr gmx.ch> wrote:Being fine is not an option. They contradict each other.On page 263, TDPL states that struct objects nested inside a function cannot be returned, because the caller does not have access to their types. Using the auto keyword, DMD lets you do this though. Is this a bug in DMD or an error in TDPL?I think that's fine.Without looking at the code, I'd assume that Local is defined something like this: struct Local { size_t s; int i; } in which case Local.sizeof would most likely be size_t.sizeof * 2 because of the alignment and implicit padding, i.e 8 bytes on x86, and 16 bytes on x64. size_t.sizeof + int.sizeof only give 12. I'd agree that this is in fact confusing and needs to be explained.I see. After further reading, the alignment of structs is indeed explained.
May 08 2011
Denis Koroskin Wrote:On Sun, 08 May 2011 17:59:02 +0400, Timon Gehr <timon.gehr gmx.ch> wrote:Why ddmd don‘t continue ? Give up ?On page 263, TDPL states that struct objects nested inside a function cannot be returned, because the caller does not have access to their types. Using the auto keyword, DMD lets you do this though. Is this a bug in DMD or an error in TDPL?I think that's fine.On the same page, the assert should be assert(Local.sizeof == size_t.sizeof + int.sizeof); rather than assert(Local.sizeof == 2*size_t.sizeof); which always fails in 64 bit. TimonWithout looking at the code, I'd assume that Local is defined something like this: struct Local { size_t s; int i; } in which case Local.sizeof would most likely be size_t.sizeof * 2 because of the alignment and implicit padding, i.e 8 bytes on x86, and 16 bytes on x64. size_t.sizeof + int.sizeof only give 12. I'd agree that this is in fact confusing and needs to be explained.
May 08 2011
On 5/8/11 8:59 AM, Timon Gehr wrote:On page 263, TDPL states that struct objects nested inside a function cannot be returned, because the caller does not have access to their types. Using the auto keyword, DMD lets you do this though. Is this a bug in DMD or an error in TDPL?Bug in TDPL.On the same page, the assert should be assert(Local.sizeof == size_t.sizeof + int.sizeof); rather than assert(Local.sizeof == 2*size_t.sizeof); which always fails in 64 bit.Thanks, added to the errata: http://erdani.com/tdpl/errata Andrei
May 08 2011
"Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message news:iq6h8h$1ph2$1 digitalmars.com...Thanks, added to the errata: http://erdani.com/tdpl/errataSpeaking of errata related to TDPL, I'm getting this in FF and IE: http://www.semitwist.com/download/tdplerrata.png And the breadcrumb links at the top aren't clickable. It works in Iron. In Opera, the big white rectangle is missing.
May 08 2011
On 5/8/11 2:10 PM, Nick Sabalausky wrote:"Andrei Alexandrescu"<SeeWebsiteForEmail erdani.org> wrote in message news:iq6h8h$1ph2$1 digitalmars.com...Thanks, I'll look into it. What version of FF and what OS? AndreiThanks, added to the errata: http://erdani.com/tdpl/errataSpeaking of errata related to TDPL, I'm getting this in FF and IE: http://www.semitwist.com/download/tdplerrata.png And the breadcrumb links at the top aren't clickable. It works in Iron. In Opera, the big white rectangle is missing.
May 08 2011
"Andrei Alexandrescu" <SeeWebsiteForEmail erdani.org> wrote in message news:iq6qth$286t$1 digitalmars.com...On 5/8/11 2:10 PM, Nick Sabalausky wrote:Heh, uh, well, FF2 ;) And IE7 (I like to keep IE at 7 so I can test my sites on it.) WinXP. Opera is 10.62"Andrei Alexandrescu"<SeeWebsiteForEmail erdani.org> wrote in message news:iq6h8h$1ph2$1 digitalmars.com...Thanks, I'll look into it. What version of FF and what OS?Thanks, added to the errata: http://erdani.com/tdpl/errataSpeaking of errata related to TDPL, I'm getting this in FF and IE: http://www.semitwist.com/download/tdplerrata.png And the breadcrumb links at the top aren't clickable. It works in Iron. In Opera, the big white rectangle is missing.
May 08 2011
What the heck.. scrolling through this new layout completely maxes out an entire core and makes the browser very sluggish. What is that page doing, protein folding? I'm on FF 3.6.16, XP32.
May 08 2011