digitalmars.D.learn - D 2.x conversion problems
- Dan (14/14) Dec 08 2007 I've been away from the scene for a while, and just picked up some old c...
- Bill Baxter (25/49) Dec 08 2007 Shot in the dark here, but it reminds me of error messages I've seen
- Dan (4/35) Dec 08 2007 No, that's quite informative. The error I was given was not alot to go ...
- Brad Roberts (6/43) Dec 08 2007 Once you track down what part of your code is tripping that error,
- jcc7 (5/11) Dec 17 2007 I came up with a small test case for an error with a missing line number...
- Dan (68/105) Dec 08 2007 Sorry, I should have provided the code I think it might be. I honestly ...
- Dan (5/5) Dec 08 2007 Please forgive that last post's duplication.
- Jesse Phillips (5/34) Dec 08 2007 Since you've been away from the scene for awhile figured you might not
I've been away from the scene for a while, and just picked up some old code I had rotting in the folder. Anyways, I tried compiling it with D 2.08 and was expecting to work through the bug reports and bring it up to speed. Unfortunately, I have no freakin' clue what to do given the compiler error I'm reading; even after reading the changelog. I would assume that somewhere in my code there is some variable named "b" that should or shouldn't be const. Anyone able to give me a better idea of what this means? ~~~ Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Code\walnut>make rcc -r -32 source\icon.rc -otemporary\icon.res cd source dmd -O -release -c -od..\temporary value.d main.d methods.d structure.d text.d test.d Error: 'b' is not a member of 'const(Value)' --- errorlevel 1 C:\Code\walnut>
Dec 08 2007
Dan wrote:I've been away from the scene for a while, and just picked up some old code I had rotting in the folder. Anyways, I tried compiling it with D 2.08 and was expecting to work through the bug reports and bring it up to speed. Unfortunately, I have no freakin' clue what to do given the compiler error I'm reading; even after reading the changelog. I would assume that somewhere in my code there is some variable named "b" that should or shouldn't be const. Anyone able to give me a better idea of what this means? ~~~ Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Code\walnut>make rcc -r -32 source\icon.rc -otemporary\icon.res cd source dmd -O -release -c -od..\temporary value.d main.d methods.d structure.d text.d test.d Error: 'b' is not a member of 'const(Value)' --- errorlevel 1 C:\Code\walnut>Shot in the dark here, but it reminds me of error messages I've seen from using named unions. Somewhere in the past you used to be able to say struct Value { union b{ int i; long l; } } Value x; x.b.i; // was ok at some point in the past But that became an error. And I believe the error message was something like "b is not a member of Value". The fix is to do something like: struct Value { union _b { int i; long l; } _b b; } Sorry if this is wrong and leads you down the wrong path! But you're not giving us a lot to go on. :-) --bb
Dec 08 2007
Bill Baxter Wrote: Dan Wrote:No, that's quite informative. The error I was given was not alot to go on either. I was pretty shocked it didn't even give me a line number or even a specific file that needed changing. Now I know I'm probably looking for a named union type. Does it matter that I have about six dozen "anonymous" unions inside my structs?Error: 'b' is not a member of 'const(Value)' --- errorlevel 1Shot in the dark here, but it reminds me of error messages I've seen from using named unions. Somewhere in the past you used to be able to say struct Value { union b{ int i; long l; } } Value x; x.b.i; // was ok at some point in the past But that became an error. And I believe the error message was something like "b is not a member of Value". The fix is to do something like: struct Value { union _b { int i; long l; } _b b; } Sorry if this is wrong and leads you down the wrong path! But you're not giving us a lot to go on. :-)
Dec 08 2007
Dan wrote:Bill Baxter Wrote: Dan Wrote:Once you track down what part of your code is tripping that error, please file a bug report, with a nice easy repro case, so the lack of a line number can be fixed. Missing line numbers for errors is just evil. Thanks, BradNo, that's quite informative. The error I was given was not alot to go on either. I was pretty shocked it didn't even give me a line number or even a specific file that needed changing. Now I know I'm probably looking for a named union type. Does it matter that I have about six dozen "anonymous" unions inside my structs?Error: 'b' is not a member of 'const(Value)' --- errorlevel 1Shot in the dark here, but it reminds me of error messages I've seen from using named unions. Somewhere in the past you used to be able to say struct Value { union b{ int i; long l; } } Value x; x.b.i; // was ok at some point in the past But that became an error. And I believe the error message was something like "b is not a member of Value". The fix is to do something like: struct Value { union _b { int i; long l; } _b b; } Sorry if this is wrong and leads you down the wrong path! But you're not giving us a lot to go on. :-)
Dec 08 2007
== Quote from Brad Roberts (braddr puremagic.com)'s article ...Once you track down what part of your code is tripping that error, please file a bug report, with a nice easy repro case, so the lack of a line number can be fixed. Missing line numbers for errors is just evil. Thanks, BradI came up with a small test case for an error with a missing line number. I posted it as: http://d.puremagic.com/issues/show_bug.cgi?id=1738
Dec 17 2007
Dan Wrote:Bill Baxter Wrote: Dan Wrote:Sorry, I should have provided the code I think it might be. I honestly don't seen anything wrong with it, because it worked on 1.05 (which I now can't download and run because it doesn't work) [code] struct Value { union { struct { uint length; char[]* keys; Value* values; } struct { union { Value[] sf; Value function(inout Value self,inout Value cc,Value[] arguments ...) nf; } ubyte arity; } Value[] a; char[] s; bool b; int i; double d; d_time dt; } struct Value { union { struct { uint length; char[]* keys; Value* values; } struct { union { Value[] sf; Value function(inout Value self,inout Value cc,Value[] arguments ...) nf; } ubyte arity; } Value[] a; char[] s; bool b; int i; double d; d_time dt; } struct Value { union { struct { uint length; char[]* keys; Value* values; } struct { union { Value[] sf; Value function(inout Value self,inout Value cc,Value[] arguments ...) nf; } ubyte arity; } Value[] a; char[] s; bool b; int i; double d; d_time dt; } ... [/code]No, that's quite informative. The error I was given was not alot to go on either. I was pretty shocked it didn't even give me a line number or even a specific file that needed changing. Now I know I'm probably looking for a named union type. Does it matter that I have about six dozen "anonymous" unions inside my structs?Error: 'b' is not a member of 'const(Value)' --- errorlevel 1Shot in the dark here, but it reminds me of error messages I've seen from using named unions. Somewhere in the past you used to be able to say struct Value { union b{ int i; long l; } } Value x; x.b.i; // was ok at some point in the past But that became an error. And I believe the error message was something like "b is not a member of Value". The fix is to do something like: struct Value { union _b { int i; long l; } _b b; } Sorry if this is wrong and leads you down the wrong path! But you're not giving us a lot to go on. :-)
Dec 08 2007
Please forgive that last post's duplication. Also, I've gone ahead and tried a minimal case for that struct, and it works just fine, and I can declare and initalize the struct. So, I have no idea what far corner of my program is causing the error. There are over 20,000 lines of code, and Value.b is pervasive in 4 out of 7 files. Since there's absolutely nothing about changing bool or anonymous unions listed in the changelogs, I'd assume this is a bug of some sort. I just don't know what kind of code generates the bug, since the error message is so amazingly ambiguous. Regards, Dan
Dec 08 2007
On Sun, 09 Dec 2007 00:45:53 -0500, Dan wrote:I've been away from the scene for a while, and just picked up some old code I had rotting in the folder. Anyways, I tried compiling it with D 2.08 and was expecting to work through the bug reports and bring it up to speed. Unfortunately, I have no freakin' clue what to do given the compiler error I'm reading; even after reading the changelog. I would assume that somewhere in my code there is some variable named "b" that should or shouldn't be const. Anyone able to give me a better idea of what this means? ~~~ Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Code\walnut>make rcc -r -32 source\icon.rc -otemporary\icon.res cd source dmd -O -release -c -od..\temporary value.d main.d methods.d structure.d text.d test.d Error: 'b' is not a member of 'const(Value)' --- errorlevel 1 C:\Code\walnut>Since you've been away from the scene for awhile figured you might not know that D has branched to a stable v1 and add/break stuff v2. If so I would suggest using dmd1.004. http://ftp.digitalmars.com/dmd.1.024.zip
Dec 08 2007
Jesse Phillips Wrote:Since you've been away from the scene for awhile figured you might not know that D has branched to a stable v1 and add/break stuff v2. If so I would suggest using dmd1.004. http://ftp.digitalmars.com/dmd.1.024.zipI tried 1.005 before, and it was throwing me a similar error (the "b is not a member of Value" one) So I tried 1.001 and got "cannot find dmd" (which is really a cannot find link.exe, 'cause it really doesn't exist) So I've since been wondering how I'm supposed to acquire link.exe when it's not in any of the dmd compiler packages, and not in the same package I got rcc from. *sigh* Anyone have the executable off-hand?
Dec 13 2007
Dan Wrote:Jesse Phillips Wrote:nm, got it from dmc.zip. : pSince you've been away from the scene for awhile figured you might not know that D has branched to a stable v1 and add/break stuff v2. If so I would suggest using dmd1.004. http://ftp.digitalmars.com/dmd.1.024.zipI tried 1.005 before, and it was throwing me a similar error (the "b is not a member of Value" one) So I tried 1.001 and got "cannot find dmd" (which is really a cannot find link.exe, 'cause it really doesn't exist) So I've since been wondering how I'm supposed to acquire link.exe when it's not in any of the dmd compiler packages, and not in the same package I got rcc from. *sigh* Anyone have the executable off-hand?
Dec 13 2007