www.digitalmars.com         C & C++   DMDScript  

D.gnu - GDC bugs (relevant up to version 0.15)

reply Neil Santos <Neil_member pathlink.com> writes:
Note that David Friedman is already aware of these bugs, and is, he tells me, in
the process of fixing them.  I'm posting them merely to let other GDC users
know, so they don't inadverdently report them again.  Obviously, if you do
encounter any one of these bugs in later version, the last doesn't apply.

You should also check if the bug noted in the following note is the same as the
one you're going to report:
http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/5061

(Actually, that would apply to all bug reports. :D)

1) Appending char to char[] segfaults GCC.  The following snippet:

char[] testing = "test";
testing ~= 'i' ~ "ng";       // <-- Line 325
printf ("%.*s\n", testing);

produces this:

string.d: In function `main':
string.d:325: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:[43]http://gcc.gnu.org/bugs.html> for instructions.

2) Assigning to a slice from a class (probably a struct, as well) that overloads
the [] operator segfaults GCC.  The following snippet:

Vector!(int) vec = new Vector!(int) (1, 2, 3, 4);
vec = vec + 2;
vec[0..1] = 3;

produces this:

string.d:318: vec[0..1] is not an lvalue
string.d:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:[43]http://gcc.gnu.org/bugs.html> for instructions.

There is, of course, no way (at this time) to overload slice assignments.  If
anyone else would to complain about D's lack of opSliceAssign, you know how to
do it. ;)

3) GDC compiles a module with multiple typesafe variadic functions fine, but
will refuse to let you use it.  Assuming functions with the following functions
are defined in sample.d:

void foo (char[][] args ...);
void bar (char[][] args ...);

then the following sample usage:

int main (char[][] args)
{
char[] qux = "cthulhu";
char[] ghu = "fiawol";
foo (qux);
bar (ghu);
}

will produce something similar to:

sample.d:42: declaration sample.main.__arrayArg is already defined

(I've sent a note to David Friedman about this, but I haven't received any
reply, so I'm not yet entirely sure whether this really is a GDC bug or a
frontend bug.)
Sep 26 2005
next sibling parent =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= <thomas-dloop kuehne.cn> writes:
Neil Santos schrieb:

[snip]

 3) GDC compiles a module with multiple typesafe variadic functions fine, but
 will refuse to let you use it.  Assuming functions with the following functions
 are defined in sample.d:
 
 void foo (char[][] args ...);
 void bar (char[][] args ...);
 
 then the following sample usage:
 
 int main (char[][] args)
 {
 char[] qux = "cthulhu";
 char[] ghu = "fiawol";
 foo (qux);
 bar (ghu);
 }
 
 will produce something similar to:
 
 sample.d:42: declaration sample.main.__arrayArg is already defined
 
 (I've sent a note to David Friedman about this, but I haven't received any
 reply, so I'm not yet entirely sure whether this really is a GDC bug or a
 frontend bug.)
Added to DStress as http://dstress.kuehnbe.cb/run/v/variadic_argument_08_A.d http://dstress.kuehnbe.cb/run/v/variadic_argument_08_B.d Thomas
Sep 28 2005
prev sibling parent "Walter Bright" <newshound digitalmars.com> writes:
"Neil Santos" <Neil_member pathlink.com> wrote in message
news:dh9sf7$268e$1 digitaldaemon.com...
 3) GDC compiles a module with multiple typesafe variadic functions fine,
but
 will refuse to let you use it.  Assuming functions with the following
functions
 are defined in sample.d:

 void foo (char[][] args ...);
 void bar (char[][] args ...);

 then the following sample usage:

 int main (char[][] args)
 {
 char[] qux = "cthulhu";
 char[] ghu = "fiawol";
 foo (qux);
 bar (ghu);
 }

 will produce something similar to:

 sample.d:42: declaration sample.main.__arrayArg is already defined

 (I've sent a note to David Friedman about this, but I haven't received any
 reply, so I'm not yet entirely sure whether this really is a GDC bug or a
 frontend bug.)
This problem is a front end bug and was corrected in 0.136.
Oct 17 2005