[Issue 953] Multiple C style declarations of same type cannot be in one statement
https://issues.dlang.org/show_bug.cgi?id=953 Vladimir Panteleevchanged: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |WORKSFORME --- Comment #8 from Vladimir Panteleev --- (In reply to Matti Niemenmaa from comment #0) > int foo[2], bar[2]; > > The above fails with the error message "multiple declarations must have the > same type, not int[2] and int[2]" which makes no sense. int[2] is the same > type as int[2]. Fixed by https://github.com/dlang/dmd/pull/4021. Now it prints: test.d(1): Deprecation: instead of C-style syntax, use D-style syntax 'int[2] foo' test.d(1): Deprecation: instead of C-style syntax, use D-style syntax 'int[2] bar' --
[Issue 953] Multiple C style declarations of same type cannot be in one statement
https://issues.dlang.org/show_bug.cgi?id=953 --- Comment #9 from Vladimir Panteleev--- *** Issue 12196 has been marked as a duplicate of this issue. *** --
[Issue 953] Multiple C style declarations of same type cannot be in one statement
https://issues.dlang.org/show_bug.cgi?id=953 Andrei Alexandrescuchanged: What|Removed |Added Keywords||bootcamp CC||and...@erdani.com --
[Issue 953] Multiple C style declarations of same type cannot be in one statement
https://issues.dlang.org/show_bug.cgi?id=953 Andrei Alexandrescu and...@erdani.com changed: What|Removed |Added Version|D1 D2 |D2 --
[Issue 953] Multiple C style declarations of same type cannot be in one statement
http://d.puremagic.com/issues/show_bug.cgi?id=953 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #7 from bearophile_h...@eml.cc 2013-07-03 10:17:37 PDT --- So this code has different meanings in C and D: void main() { int *a, b; } And to keep the D language simple this is disallowed: int a[8], c[8]; Then what is this issue asking for? In Issue 5807 I have suggested to disallow mixing C and D style of array in a single declaration: // array of 5 dynamic arrays of ints. int[][5] c; int[] c[5]; int c[5][]; Also because of some problems it causes with vector ops syntax: void main() { int[] a1 = [1, 2, 3]; int[] a2 = new int[3]; a2[] = a1[]; // OK int[3] a3[] = a2[];// line 5, Error } Beside disallowing the mix of C and D syntaxes in a single declaration, another thing that may be good to do is to perpetually deprecate the C syntax (and do not turn it into an error). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 953] Multiple C style declarations of same type cannot be in one statement
http://d.puremagic.com/issues/show_bug.cgi?id=953 Andrej Mitrovic andrej.mitrov...@gmail.com changed: What|Removed |Added Priority|P4 |P2 CC||andrej.mitrov...@gmail.com Platform|x86 |All Version|1.005 |D1 D2 AssignedTo|bugzi...@digitalmars.com|nob...@puremagic.com OS/Version|Windows |All Severity|trivial |normal --- Comment #4 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-20 11:37:50 PST --- This affects both D1 and D2. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 953] Multiple C style declarations of same type cannot be in one statement
http://d.puremagic.com/issues/show_bug.cgi?id=953 --- Comment #5 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-20 11:45:33 PST --- This would be more simple to implement if we simply destroyed C-style array syntax. I don't know why we're waiting so long to get rid of them. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 953] Multiple C style declarations of same type cannot be in one statement
http://d.puremagic.com/issues/show_bug.cgi?id=953 --- Comment #6 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-01-20 11:46:05 PST --- (In reply to comment #5) This would be more simple to implement if we simply destroyed C-style array syntax. Read that as: C-style declarations, because it also affects pointers. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---