digitalmars.D.bugs - Segfaults on Constant Definitions
- John Reimer (40/40) Feb 20 2005 OS:
- zwang (2/5) Feb 20 2005 dmd win32 fails too.
- Kris (4/44) Feb 23 2005 consts are sometimes astonishingly weak in D. I bet it would be fine if ...
- John Reimer (5/11) Feb 23 2005 Thanks, Kris. If there's so much trouble with const's, I think this
- kris (6/18) Feb 23 2005 No question about it :)
- =?ISO-8859-1?Q?Thomas_K=FChne?= (44/44) Mar 11 2005 -----BEGIN PGP SIGNED MESSAGE-----
OS: Gentoo Linux with Kernel 2.6 D Compiler: dmd version 0.113 CODE: OUTPUT: test4(8):50*50 is not an expression test4(9):a1 - 1 * a2 - 1 is not an expression Segmentation fault PROBLEM: The compiler balks on calculated constant expressions. In arrays 1-3, take out the "4*" in the array dimension to get a different set of errors (no segfault). Comment out the individual array declarations to get more complaints from the compiler. Furthermore, remove all array declarations to get /no/ complaints from the compiler. The compiler error only shows up when you attempt to use the constants. Since const values are the only replacement solution for the C preprocessor "#define", why are these expressions incalculable? Win32 version not tested! - John R.
Feb 20 2005
John Reimer wrote:Win32 version not tested! - John R.dmd win32 fails too.
Feb 20 2005
In article <pan.2005.02.20.14.41.58.234018 yahoo.com>, John Reimer says...OS: Gentoo Linux with Kernel 2.6 D Compiler: dmd version 0.113 CODE: OUTPUT: test4(8):50*50 is not an expression test4(9):a1 - 1 * a2 - 1 is not an expression Segmentation fault PROBLEM: The compiler balks on calculated constant expressions. In arrays 1-3, take out the "4*" in the array dimension to get a different set of errors (no segfault). Comment out the individual array declarations to get more complaints from the compiler. Furthermore, remove all array declarations to get /no/ complaints from the compiler. The compiler error only shows up when you attempt to use the constants. Since const values are the only replacement solution for the C preprocessor "#define", why are these expressions incalculable? Win32 version not tested! - John R.consts are sometimes astonishingly weak in D. I bet it would be fine if you used enum instead - Kris
Feb 23 2005
Kris wrote:consts are sometimes astonishingly weak in D. I bet it would be fine if you used enum instead - KrisThanks, Kris. If there's so much trouble with const's, I think this should be fixed. I'll see what enum can do for me. I guess a template could even be a solution, if not overkill. - John R.
Feb 23 2005
John Reimer wrote:Kris wrote:No question about it :) Frankly, I'd prefer Walter to remove const completely until he's spent some time thinking about how to correctly implement read-only variables, and the related ROM-based reference data. I doubt that will happen though. - Krisconsts are sometimes astonishingly weak in D. I bet it would be fine if you used enum instead - KrisThanks, Kris. If there's so much trouble with const's, I think this should be fixed.
Feb 23 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John Reimer wrote: | OS: | Gentoo Linux with Kernel 2.6 | | D Compiler: | dmd version 0.113 | | CODE: | | OUTPUT: | test4(8):50*50 is not an expression | test4(9):a1 - 1 * a2 - 1 is not an expression | Segmentation fault Added to DStress as http://dstress.kuehne.cn/run/const_14.d Thomas -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (MingW32) iD8DBQFCMp3v3w+/yD4P9tIRAjfVAJ93J6BZgYsn2gTxA9Xvsve3cKq3/wCgsVjA KJzlRlQ6/lvX1/LQXEfkRl0= =HxV0 -----END PGP SIGNATURE-----
Mar 11 2005