Jump to page: 1 2 3
Thread overview
stupid errors
Mar 20, 2006
debugger
Mar 20, 2006
Derek Parnell
Mar 21, 2006
debugger
Mar 21, 2006
Regan Heath
Mar 21, 2006
Derek Parnell
Mar 22, 2006
debugger
Mar 22, 2006
Regan Heath
Mar 22, 2006
Brad Roberts
Mar 22, 2006
Derek Parnell
Mar 21, 2006
Tom
Mar 22, 2006
debugger
Mar 22, 2006
Kyle Furlong
Mar 22, 2006
John Reimer
Mar 22, 2006
BCS
Mar 22, 2006
John Reimer
Mar 22, 2006
BCS
Mar 23, 2006
debugger
Mar 23, 2006
Regan Heath
Mar 23, 2006
Tom
Mar 23, 2006
BCS
Mar 24, 2006
Kyle Furlong
Mar 24, 2006
Dave
Mar 22, 2006
Tom
March 20, 2006
Detecting errors like this:

SomeType f(){
SomeType result;
result= SOMECONST;
return result;
}

void g(){
SomeType value;
value= f();
switch( value){
case SOMECONST:
assert( value == SOMECONST); // fails !!!
}
}

is no reputation for any language.

Changing the switch to cascaded if's worked okay, but for six years developing this kind of bug is @!*$ and I am not interested in wasting my time


March 20, 2006
On Tue, 21 Mar 2006 02:11:32 +1100, debugger <debugger_member@pathlink.com> wrote:

> Detecting errors like this:
>
> SomeType f(){
> SomeType result;
> result= SOMECONST;
> return result;
> }
>
> void g(){
> SomeType value;
> value= f();
> switch( value){
> case SOMECONST:
> assert( value == SOMECONST); // fails !!!
> }
> }
>
> is no reputation for any language.
>
> Changing the switch to cascaded if's worked okay, but for six years developing
> this kind of bug is @!*$ and I am not interested in wasting my time

I just tried this using dmd v.150 and Windows XP and it works fine.

-- 
Derek Parnell
Melbourne, Australia
March 21, 2006
Derek Parnell says...
>> this kind of bug is @!*$ and I am not interested in wasting my time
>I just tried this using dmd v.150 and Windows XP and it works fine.

Lucky you. But I am really not interested in wasting my time by working in a buggy language nor by cutting my source down to the essential raising that bug.

In fact the control flow took even the wrong path:

switch( value){
case SOMECONST:
assert( false); // not executed
break;
case SOMEOTHERCONST:
assert( value == SOMEOTHERCONST); // failed
}



March 21, 2006
On Tue, 21 Mar 2006 00:44:29 +0000 (UTC), debugger <debugger_member@pathlink.com> wrote:
> Derek Parnell says...
>>> this kind of bug is @!*$ and I am not interested in wasting my time
>> I just tried this using dmd v.150 and Windows XP and it works fine.
>
> Lucky you. But I am really not interested in wasting my time by working in a
> buggy language nor by cutting my source down to the essential raising that bug.
>
> In fact the control flow took even the wrong path:
>
> switch( value){
> case SOMECONST:
> assert( false); // not executed
> break;
> case SOMEOTHERCONST:
> assert( value == SOMEOTHERCONST); // failed
> }

It's your loss. Can you please at least post the code here so we can figure out whats going on.

Regan
March 21, 2006
On Tue, 21 Mar 2006 00:44:29 +0000 (UTC), debugger wrote:

> Derek Parnell says...
>>> this kind of bug is @!*$ and I am not interested in wasting my time
>>I just tried this using dmd v.150 and Windows XP and it works fine.
> 
> Lucky you. But I am really not interested in wasting my time by working in a buggy language nor by cutting my source down to the essential raising that bug.

Of course you mean 'buggy compiler' and not 'buggy language', but that aside for now ... dmd v0.150 is *BETA* --- it is expected to have bugs in it still and that's why we are trying to find and fix them.

If you don't want to help fix the compiler then fine, go away and come back later when other's have done the good deeds.

My earlier reply was trying to say that the compiler is working in at least
one environment so I assume you are not working in Windows or not using
v0.150, or your code example is faulty because it doesn't exhibit the
problem you reported.

> In fact the control flow took even the wrong path:
> 
> switch( value){
> case SOMECONST:
> assert( false); // not executed
> break;
> case SOMEOTHERCONST:
> assert( value == SOMEOTHERCONST); // failed
> }

If you actually want this resolved, try showing us a complete (compilable) example that exhibits the problem. Until then, I'm assuming you have made a coding error rather than dmd is at fault. Prove otherwise.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocracy!"
21/03/2006 12:21:42 PM
March 21, 2006
debugger escribió:
> Detecting errors like this:
> 
> SomeType f(){
> SomeType result;
> result= SOMECONST;
> return result;
> }
> 
> void g(){
> SomeType value;
> value= f();
> switch( value){
> case SOMECONST:
> assert( value == SOMECONST); // fails !!!
> }
> }
> 
> is no reputation for any language.
> 
> Changing the switch to cascaded if's worked okay, but for six years developing
> this kind of bug is @!*$ and I am not interested in wasting my time

Sorry, I can't contain myself but, what an asshole.

Tom;
March 22, 2006
In article <1gjg8vs07wl1o$.tifrma18o0v$.dlg@40tude.net>, Derek Parnell says...
> that's why we are trying to find and fix them.
Who is we? I see, you are a member of the acknowledged crowd ... then stay tuned until version 2.0 is released ... I want to see how many fingers will point into different directions when that bug in the reference compiler is still undetected.
>If you actually want this resolved, try showing us a complete (compilable) example that exhibits the problem. Until then, I'm assuming you have made a coding error rather than dmd is at fault. Prove otherwise.
I work for money, not for reputation. Assume what you want, especially that the other code example in my "stops compiling" post does not exhibit any problem.

If you want a proof: pay.

Otherwise continue with your planless search and keep on whining about people who know more than your acknowledged crowd.


March 22, 2006
Tom says...
>Sorry, I can't contain myself but, what an asshole.

Yes I am. And I like to work with other assholes, because in contrast to you they know how to get rid of their excrements themselves.


March 22, 2006
On Wed, 22 Mar 2006 04:20:29 +0000 (UTC), debugger <debugger_member@pathlink.com> wrote:
> In article <1gjg8vs07wl1o$.tifrma18o0v$.dlg@40tude.net>, Derek Parnell says...
>> that's why we are trying to find and fix them.
> Who is we? I see, you are a member of the acknowledged crowd ... then stay tuned
> until version 2.0 is released ... I want to see how many fingers will point into
> different directions when that bug in the reference compiler is still
> undetected.
>> If you actually want this resolved, try showing us a complete (compilable)
>> example that exhibits the problem. Until then, I'm assuming you have made a
>> coding error rather than dmd is at fault. Prove otherwise.
> I work for money, not for reputation. Assume what you want, especially that the
> other code example in my "stops compiling" post does not exhibit any problem.
>
> If you want a proof: pay.
>
> Otherwise continue with your planless search and keep on whining about people who know more than your acknowledged crowd.

If you've got nothing constructive to add stop posting, or, keep posting if it makes you happy just be prepared to be ignored as a "troll". Given the inflamatory nature of your post I am surprised you only got 1 agressive response.

As Derek politely pointed out, you didn't post a complete example. Without a complete example there is no way for us to help you, in which case why post at all? (unless you're simply trolling?).

I've done my best to produce a complete example, here is what I came up with:

alias int SomeType;

SomeType f(){
	SomeType result;
	result = 1;
	return result;
}

void g(){
	SomeType value;
	value = f();	
	switch(value){
	case 1:
		assert(value == 1); // fails !!!
	}
}

void main()
{
	g();
}

I assume you meant for us to replace SOMECONST with an integer constant, if not, let me know what it was because nothing else I tried would compile. Using the code above I get no assert, which is the correct behaviour.

Regan
March 22, 2006
On Wed, 22 Mar 2006, Regan Heath wrote:
> On Wed, 22 Mar 2006 04:20:29 +0000 (UTC), debugger
> <debugger_member@pathlink.com> wrote:
> > In article <1gjg8vs07wl1o$.tifrma18o0v$.dlg@40tude.net>, Derek Parnell says...

<snip pointless flamebait>

> If you've got nothing constructive to add stop posting, or, keep posting if it makes you happy just be prepared to be ignored as a "troll". Given the inflamatory nature of your post I am surprised you only got 1 agressive response.
> 
> As Derek politely pointed out, you didn't post a complete example. Without a complete example there is no way for us to help you, in which case why post at all? (unless you're simply trolling?).
> 
> I've done my best to produce a complete example, here is what I came up with:
> 
> alias int SomeType;
> 
> SomeType f(){
> 	SomeType result;
> 	result = 1;
> 	return result;
> }
> 
> void g(){
> 	SomeType value;
> 	value = f();		switch(value){
> 	case 1:
> 		assert(value == 1); // fails !!!
> 	}
> }
> 
> void main()
> {
> 	g();
> }
> 
> I assume you meant for us to replace SOMECONST with an integer constant, if not, let me know what it was because nothing else I tried would compile. Using the code above I get no assert, which is the correct behaviour.
> 
> Regan

I also tried this example with s/1/SOMECONST/ and adding this block at the top:

//alias char[] SomeType;
//const char[] SOMECONST = "abcde";
alias int SomeType;
const int SOMECONST = 1;

Neither the char[] nor the int version assert for me.

I used my gdc 0.18 pre-release as well as dmd 0.148 and 0.149, all on linux.  I haven't grabbed 0.150 but Derek reported an inability to reproduce the problem with 0.150 on xp earlier in the thread.

So, debugger, despite your arrogance and disdane for the rest of the D community, there's interesting in fixing bugs in the D compiler both from it's primary author and it's supporting team.  If you'd be so kind as to point out the difference between these test cases and your as-of-yet undisclosed repro case, it'd be appreciated.  If you'd also point out what compiler and platform you used that'd help too.

Thanks,
Brad
« First   ‹ Prev
1 2 3