D.gnu - GDC specific bugs
- Thomas Kuehne (12/12) Dec 11 2004 http://svn.kuehne.cn/dstress/run/break_03.d
- John Reimer (5/19) Dec 11 2004 For the "enum" stress tests, I notice that a semicolon is used to end
- Thomas Kuehne (3/19) Dec 12 2004 Thanks, I removed the semicolon. The change had no impact.
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (8/13) Dec 12 2004 If D had supported warnings, it would probably be appropriate
- Thomas Kuehne (22/33) Dec 12 2004 -----BEGIN PGP SIGNED MESSAGE-----
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (10/31) Dec 12 2004 True, then it *should* be made into an error after all...
- John Reimer (6/34) Dec 12 2004 Perhaps the semicolon is indeed optional. I now see that the D language...
- J C Calvarese (33/48) Dec 13 2004 As far as I can tell DMD doesn't care if you have empty statements (just...
- John Reimer (5/69) Dec 13 2004 Hello Justin,
http://svn.kuehne.cn/dstress/run/break_03.d http://svn.kuehne.cn/dstress/run/break_04.d http://svn.kuehne.cn/dstress/run/break_05.d http://svn.kuehne.cn/dstress/nocompile/command_line_deprecated_02.d http://svn.kuehne.cn/dstress/run/delegate_04.d http://svn.kuehne.cn/dstress/nocompile/delegate_05.d http://svn.kuehne.cn/dstress/run/delegate_12.d http://svn.kuehne.cn/dstress/run/enum_07.d http://svn.kuehne.cn/dstress/run/enum_08.d http://svn.kuehne.cn/dstress/run/enum_09.d http://svn.kuehne.cn/dstress/complex/linking/ (linking_01) http://svn.kuehne.cn/dstress/nocompile/static_08.d
Dec 11 2004
Thomas Kuehne wrote:http://svn.kuehne.cn/dstress/run/break_03.d http://svn.kuehne.cn/dstress/run/break_04.d http://svn.kuehne.cn/dstress/run/break_05.d http://svn.kuehne.cn/dstress/nocompile/command_line_deprecated_02.d http://svn.kuehne.cn/dstress/run/delegate_04.d http://svn.kuehne.cn/dstress/nocompile/delegate_05.d http://svn.kuehne.cn/dstress/run/delegate_12.d http://svn.kuehne.cn/dstress/run/enum_07.d http://svn.kuehne.cn/dstress/run/enum_08.d http://svn.kuehne.cn/dstress/run/enum_09.d http://svn.kuehne.cn/dstress/complex/linking/ (linking_01) http://svn.kuehne.cn/dstress/nocompile/static_08.dFor the "enum" stress tests, I notice that a semicolon is used to end the enum declaration. The D standard declares them without a semicolon appended. Would removing the semicolon change the stress test results? - John
Dec 11 2004
John Reimer schrieb:Thomas Kuehne wrote:http://svn.kuehne.cn/dstress/run/break_03.d http://svn.kuehne.cn/dstress/run/break_04.d http://svn.kuehne.cn/dstress/run/break_05.d http://svn.kuehne.cn/dstress/nocompile/command_line_deprecated_02.d http://svn.kuehne.cn/dstress/run/delegate_04.d http://svn.kuehne.cn/dstress/nocompile/delegate_05.d http://svn.kuehne.cn/dstress/run/delegate_12.d http://svn.kuehne.cn/dstress/run/enum_07.d http://svn.kuehne.cn/dstress/run/enum_08.d http://svn.kuehne.cn/dstress/run/enum_09.d http://svn.kuehne.cn/dstress/complex/linking/ (linking_01) http://svn.kuehne.cn/dstress/nocompile/static_08.dFor the "enum" stress tests, I notice that a semicolon is used to end the enum declaration. The D standard declares them without a semicolon appended. Would removing the semicolon change the stress test results?Thanks, I removed the semicolon. The change had no impact. Thomas
Dec 12 2004
Thomas Kuehne wrote:If D had supported warnings, it would probably be appropriate to issue one for extra semicolons after enum and class and such... But since it doesn't, it's really not enough to trigger an error. Maybe it (D) does need some kind of -pedantic flag, like GCC has ? "verify program according to the standard and strict specification" (do some "lint" checks that takes forever but sometimes catches bugs?) --andersFor the "enum" stress tests, I notice that a semicolon is used to end the enum declaration. The D standard declares them without a semicolon appended. Would removing the semicolon change the stress test results?Thanks, I removed the semicolon. The change had no impact.
Dec 12 2004
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Anders schrieb:http://digitalmars.com/d/statement.html#expression "" (empty) has no affect, thus it's illegal. Thomas diff -ur dmd-109/dmd/src/dmd/parse.c neu/dmd/src/dmd/parse.c - --- dmd-109/dmd/src/dmd/parse.c 2004-12-03 01:19:56.000000000 +0100 +++ neu/dmd/src/dmd/parse.c 2004-12-12 12:15:46.857412128 +0100 -475,6 +475,7 } case TOKsemicolon: // empty declaration + error("empty declaration in front of semicolon"); nextToken(); continue; -----BEGIN PGP SIGNATURE----- iD8DBQFBvCzc3w+/yD4P9tIRAhoYAKCbExq/KOoPmFi7f3k+JRrBQV2etACZAQ6X tew9aHPuIHwvu+5Sb0UYDFE= =UsUD -----END PGP SIGNATURE-----If D had supported warnings, it would probably be appropriate to issue one for extra semicolons after enum and class and such... But since it doesn't, it's really not enough to trigger an error. Maybe it (D) does need some kind of -pedantic flag, like GCC has ? "verify program according to the standard and strict specification" (do some "lint" checks that takes forever but sometimes catches bugs?)For the "enum" stress tests, I notice that a semicolon is used to end the enum declaration. The D standard declares them without a semicolon appended. Would removing the semicolon change the stress test results?Thanks, I removed the semicolon. The change had no impact.
Dec 12 2004
Thomas Kuehne wrote:http://digitalmars.com/d/statement.html#expression "" (empty) has no affect, thus it's illegal.True, then it *should* be made into an error after all... Right now there seems to be NO such warnings implemented in GDC:void main() { };void main() { ; }void main() { null; }void main() { int x; (x + x); }GCC says "warning: statement with no effect" for 3) and 4) above (i.e. for the C versions of them, changed to "int main()") and for 1) "warning: ISO C does not allow extra `;' outside of a function" Losing the extra semicolon after *some* declarations is a Good Thing, even if it makes it C-incompatible ? (a little like functions with no arguments, or casts) --anders
Dec 12 2004
Thomas Kuehne wrote:John Reimer schrieb:Perhaps the semicolon is indeed optional. I now see that the D language docs actual use a semicolon to end an enum in some examples, although it doesn't seem to appear in the actual enum definition portion of the docs. I guess it's probably just one of those C carry-over features. - JohnThomas Kuehne wrote:http://svn.kuehne.cn/dstress/run/break_03.d http://svn.kuehne.cn/dstress/run/break_04.d http://svn.kuehne.cn/dstress/run/break_05.d http://svn.kuehne.cn/dstress/nocompile/command_line_deprecated_02.d http://svn.kuehne.cn/dstress/run/delegate_04.d http://svn.kuehne.cn/dstress/nocompile/delegate_05.d http://svn.kuehne.cn/dstress/run/delegate_12.d http://svn.kuehne.cn/dstress/run/enum_07.d http://svn.kuehne.cn/dstress/run/enum_08.d http://svn.kuehne.cn/dstress/run/enum_09.d http://svn.kuehne.cn/dstress/complex/linking/ (linking_01) http://svn.kuehne.cn/dstress/nocompile/static_08.dFor the "enum" stress tests, I notice that a semicolon is used to end the enum declaration. The D standard declares them without a semicolon appended. Would removing the semicolon change the stress test results?Thanks, I removed the semicolon. The change had no impact. Thomas
Dec 12 2004
John Reimer wrote:Thomas Kuehne wrote:As far as I can tell DMD doesn't care if you have empty statements (just as comments are ignored). I don't have a problem with that. If you're relying on ";" to do something, I don't think a warning or an error is going to help you much. On the other hand, I understand why "int i; i;" should be disallowed. I can see all kinds of bugs that can be prevented by prohibiting that. By the way, DMD compiles the following code without complaint: ; ; ; enum { item1, item2, item3 } enum { a, b, c }; int main() { ; ; return 1; } My two cents... -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/Thanks, I removed the semicolon. The change had no impact. ThomasPerhaps the semicolon is indeed optional. I now see that the D language docs actual use a semicolon to end an enum in some examples, although it doesn't seem to appear in the actual enum definition portion of the docs. I guess it's probably just one of those C carry-over features. - John
Dec 13 2004
Hello Justin, Yeah... you are probably right. D's flexibility with spurious semicolons is probably not something to lose sleep over. :-) - John J C Calvarese wrote:John Reimer wrote:Thomas Kuehne wrote:As far as I can tell DMD doesn't care if you have empty statements (just as comments are ignored). I don't have a problem with that. If you're relying on ";" to do something, I don't think a warning or an error is going to help you much. On the other hand, I understand why "int i; i;" should be disallowed. I can see all kinds of bugs that can be prevented by prohibiting that. By the way, DMD compiles the following code without complaint: ; ; ; enum { item1, item2, item3 } enum { a, b, c }; int main() { ; ; return 1; } My two cents...Thanks, I removed the semicolon. The change had no impact. ThomasPerhaps the semicolon is indeed optional. I now see that the D language docs actual use a semicolon to end an enum in some examples, although it doesn't seem to appear in the actual enum definition portion of the docs. I guess it's probably just one of those C carry-over features. - John
Dec 13 2004