digitalmars.D - [dmd 0.98] little bug
- ? (12/12) Aug 12 2004 Hello,
- Id (8/20) Aug 12 2004 Hey, take a look at it more carefully, the error is yours!
- Sebastian Beschke (5/40) Aug 12 2004 Sure, but the compiler should probably give an error message that's a
- Helmut Leitner (10/43) Aug 12 2004 Maybe the point is: the error message could be more readable
- Dawid =?UTF-8?B?Q2nEmcW8YXJraWV3aWN6?= (5/17) Aug 12 2004 This what you get when you use printf.
- Derek Parnell (10/24) Aug 12 2004 Its got nothing to do with 'printf' or 'writef'. The problem is with
- Dawid =?UTF-8?B?Q2nEmcW8YXJraWV3aWN6?= (10/15) Aug 13 2004 This is what I mean.
- Ilya Minkov (22/27) Aug 13 2004 o
- J C Calvarese (11/29) Aug 12 2004 Good catch. I'm cross-posting this to the bug newsgroup, so that it
Hello, i'm a newbee coder in D, and after a lot of work, i have create a code whitch bug the compilator dmd * Internal error: ..\ztc\cod1.c 2495 (I use dmd 0.98 for windows, and i use win xp) we can see here the code which bug the compilator //mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm void fo_O1() { } void fo_O2() { printf("%d",fo_O1()); }
Aug 12 2004
In article <cffkt9$25ja$1 digitaldaemon.com>, ? says...Hello, i'm a newbee coder in D, and after a lot of work, i have create a code whitch bug the compilator dmd * Internal error: ..\ztc\cod1.c 2495 (I use dmd 0.98 for windows, and i use win xp) we can see here the code which bug the compilator //mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm void fo_O1() { } void fo_O2() { printf("%d",fo_O1()); }Hey, take a look at it more carefully, the error is yours! You're basically saying "print the result that fo_o1() gives as a integer". But you didn't see that method fo_01() returns void, that is, DOESN'T RETURN ANYTHING. So, how do you want to print a result that doesn't exist? This will work: int fo_O1(){ return -1; } void fo_O2(){ printf("%d", fo_O1()); }
Aug 12 2004
Id wrote:In article <cffkt9$25ja$1 digitaldaemon.com>, ? says...Sure, but the compiler should probably give an error message that's a little more helpful. So this could actually classify as an, insignificant, compiler bug. -SebastianHello, i'm a newbee coder in D, and after a lot of work, i have create a code whitch bug the compilator dmd * Internal error: ..\ztc\cod1.c 2495 (I use dmd 0.98 for windows, and i use win xp) we can see here the code which bug the compilator //mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm void fo_O1() { } void fo_O2() { printf("%d",fo_O1()); }Hey, take a look at it more carefully, the error is yours! You're basically saying "print the result that fo_o1() gives as a integer". But you didn't see that method fo_01() returns void, that is, DOESN'T RETURN ANYTHING. So, how do you want to print a result that doesn't exist? This will work: int fo_O1(){ return -1; } void fo_O2(){ printf("%d", fo_O1()); }
Aug 12 2004
Id wrote:In article <cffkt9$25ja$1 digitaldaemon.com>, ? says...Maybe the point is: the error message could be more readable for example: error: illegal use of void as value instead of: Internal error: ..\ztc\cod1.c 2495 In fact the (little) error is that it is not an "Internal error". -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.comHello, i'm a newbee coder in D, and after a lot of work, i have create a code whitch bug the compilator dmd * Internal error: ..\ztc\cod1.c 2495 (I use dmd 0.98 for windows, and i use win xp) we can see here the code which bug the compilator //mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm void fo_O1() { } void fo_O2() { printf("%d",fo_O1()); }Hey, take a look at it more carefully, the error is yours! You're basically saying "print the result that fo_o1() gives as a integer". But you didn't see that method fo_01() returns void, that is, DOESN'T RETURN ANYTHING. So, how do you want to print a result that doesn't exist? This will work: int fo_O1(){ return -1; } void fo_O2(){ printf("%d", fo_O1()); }
Aug 12 2004
Helmut Leitner wrote:This what you get when you use printf. -- Dawid Ciężarkiewicz | arael jid: arael fov.plThis will work: int fo_O1(){ return -1; } void fo_O2(){ printf("%d", fo_O1()); }Maybe the point is: the error message could be more readable for example: error: illegal use of void as value instead of: Internal error: ..\ztc\cod1.c 2495 In fact the (little) error is that it is not an "Internal error".
Aug 12 2004
On Fri, 13 Aug 2004 01:15:06 +0200, Dawid Ciê¿arkiewicz wrote:Helmut Leitner wrote:Its got nothing to do with 'printf' or 'writef'. The problem is with varadic arguments. Try this ... -- Derek Melbourne, Australia 13/Aug/04 10:10:06 AMThis what you get when you use printf.This will work: int fo_O1(){ return -1; } void fo_O2(){ printf("%d", fo_O1()); }Maybe the point is: the error message could be more readable for example: error: illegal use of void as value instead of: Internal error: ..\ztc\cod1.c 2495 In fact the (little) error is that it is not an "Internal error".
Aug 12 2004
Derek Parnell wrote:This is what I mean. BTW. Why to keep varadic arguments in D? I'm just courious. Wouldn't be good to let it by used with "C" linkage only. IMHO banning it let compiler to use PASCAL like function returning with asm { "ret <number>" } which I read is more efficient. I'm not the expert, but I always thought that variadic arguments lays in C++ becouse of C compatiblity. Maybe D should leave it. -- Dawid Ciężarkiewicz | arael jid: arael fov.plIts got nothing to do with 'printf' or 'writef'. The problem is with varadic arguments.In fact the (little) error is that it is not an "Internal error".This what you get when you use printf.
Aug 13 2004
Dawid Ci=C4=99=C5=BCarkiewicz schrieb:BTW. Why to keep varadic arguments in D? I'm just courious. Wouldn't be=goodto let it by used with "C" linkage only. IMHO banning it let compiler t=ouse PASCAL like function returning with asm { "ret <number>" } which I =readis more efficient. I'm not the expert, but I always thought that variad=icarguments lays in C++ becouse of C compatiblity. Maybe D should leave i=t. In fact, it's not really used in D - and those funcs in question are C=20 library functions. But why drop it? It's as crippled as in C. And we don't have a good=20 replacement for it yet, such as powerful array literals. And there=20 probably won't be any problem adding another varargs system later, as=20 the time comes - they can coexist well. In C, varargs affects performance, because the possible ambiguity=20 requieres that all functions have the same calling convention, which=20 happens to be a caller clean-up. C++ and D requiere that the functions=20 be declared before use, thus there is no ambiguity and the compilers=20 choose a calling convention depending on the function prototype - for=20 varargs functions caller clean-up is used, otherwise the more efficient=20 callee clean-up with possible register use. On the other hand, would we loose anything by disallowing varargs in "D" = convention right now? -eye
Aug 13 2004
? wrote:Hello, i'm a newbee coder in D, and after a lot of work, i have create a code whitch bug the compilator dmd * Internal error: ..\ztc\cod1.c 2495 (I use dmd 0.98 for windows, and i use win xp) we can see here the code which bug the compilator //mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm void fo_O1() { } void fo_O2() { printf("%d",fo_O1()); }Good catch. I'm cross-posting this to the bug newsgroup, so that it might be easier for Walter to find and fix. *Bugs newsgroup for DMD* web interface: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs usenet interface: news://news.digitalmars.com/digitalmars.D.bugs -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Aug 12 2004
I reported it last month, news:cdt84u$pem$1 digitaldaemon.com
Aug 12 2004
In article <cfh3pg$2qm6$1 digitaldaemon.com>, Vathix says...I reported it last month, news:cdt84u$pem$1 digitaldaemon.comooops : ), but now and with you, i know the link "Bugs newsgroup for DMD"
Aug 13 2004