digitalmars.D.bugs - -831 is not an expression
- Brian Hjøllund (9/9) Jan 10 2005 I've discovered what I consider to be a bug.
- Thomas Kuehne (12/15) Jan 10 2005 -----BEGIN PGP SIGNED MESSAGE-----
- Brian Hjøllund (13/14) Jan 11 2005 You're right, I just tried it on it's own. So I trimmed the source a bit...
- Thomas Kuehne (11/11) Jan 11 2005 -----BEGIN PGP SIGNED MESSAGE-----
I've discovered what I consider to be a bug. I used the search functionality provided by the site to see if any other posts had been made about it, and I was unable to find any. If I missed it, I apologize for this redundant post. Anyway, this throws the above error: const int RBN_FIRST = -831; Apparently, I'm not allowed to assign negative values to a const variable. Is this a bug, or by design? If so, why? /Brian
Jan 10 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Brian Hjøllund wrote:Anyway, this throws the above error: const int RBN_FIRST = -831;I can remember seeing that error message in a similar situation. The problem is that the line alone doesn't throw the message. (Linux dmd-110/gdc-0.10) Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFB43Pj3w+/yD4P9tIRAmD7AJ9cygnSm3vSkzIndh4t1rs2KIM6mACgxhYw Shjkqxj085A+JUqCibftEQ0= =T2jx -----END PGP SIGNATURE-----
Jan 10 2005
The problem is that the line alone doesn't throw the message.You're right, I just tried it on it's own. So I trimmed the source a bit, and finally came up with the following: int main() { return 0; } const int RBN_FIRST = -831; enum { RBN_HEIGHTCHANGE = RBN_FIRST } I'm using DMD 0.110 on Windows XP SP2, Danish edition /Brian
Jan 11 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Added to DStress as http://dstress.kuehne.cn/compile/const_12.d http://dstress.kuehne.cn/compile/const_13.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFB4/9I3w+/yD4P9tIRAgCeAKCAvH9uaEjIuRb+hx7GyUQkVghaCgCghikv ZTgRqafY+4a8MAjePxXrd1A= =6Mx3 -----END PGP SIGNATURE-----
Jan 11 2005