www.digitalmars.com         C & C++   DMDScript  

D - compiler crash

reply Lewis Miller <Lewis_member pathlink.com> writes:
i dont know if this is a bug (i do know its a green programmer!) but when i
tried to compile the following code the compiler crashed

import std.c.stdio;


int main( char [] [] args ) { 
int i;
i = 0;
while ( i < 2000 ) 
{
i++
printf((*wchar i))

} 
printf("blah blaha";) 
printf("Hello lewis !");
return 0;
}

i guess im under the impression that the compiler shouldnt crash, it should
issue a bad build error?

here the output from the debugger

http://deth.thesolarapex.com/error2.gif

sorry if im being a pain, just trying to understand
Dec 09 2003
next sibling parent reply Lewis Miller <Lewis_member pathlink.com> writes:
ok we have success, but program terminates with one badass beep :)


import std.c.stdio;

int main( char [] [] args ) { 
int i;
i = 0;
while ( i < 2000 ) 
{
i++;
printf("%C", i);

} 
printf("blah blah"); 
printf("Hello lewis !");
return 0;
}
Dec 09 2003
parent "Charles Sanders" <sanders-consulting comcast.net> writes:
This is all sounds really odd, I have had similar problems but downloading a
new DMD fixed it, ill check the version that ships with DIDE, try
downloading latest and see if problem persists ?

also %d for the number, %c for char ;).

C

"Lewis Miller" <Lewis_member pathlink.com> wrote in message
news:br5plh$1bdl$1 digitaldaemon.com...
 ok we have success, but program terminates with one badass beep :)


 import std.c.stdio;

 int main( char [] [] args ) {
 int i;
 i = 0;
 while ( i < 2000 )
 {
 i++;
 printf("%C", i);

 }
 printf("blah blah");
 printf("Hello lewis !");
 return 0;
 }

Dec 09 2003
prev sibling next sibling parent "Walter" <walter digitalmars.com> writes:
No prob, I'll take care of it.
Dec 09 2003
prev sibling parent reply Antti =?iso-8859-1?Q?Syk=E4ri?= <jsykari gamma.hut.fi> writes:
A thing that's been annoying me for a long time...

Quite a lot of messages in this newsgroup seem to have had their TAB
characters stripped.  Which, obviously, makes tab-indented code examples
rather difficult to read.  I'm skipping the longer and more complicated
code examples just because I'm just too lazy to read code that isn't
indented properly.

Is it a problem in the news server (if so, could it possibly be
configured away) or in some individual newsreader?

Example:

 int main( char [] [] args ) { 
 int i;
 i = 0;
 while ( i < 2000 ) 
 {
 i++
 printf((*wchar i))
 
 } 
 printf("blah blaha";) 
 printf("Hello lewis !");
 return 0;
 }

Hmm... I never used tabs but let's try for this time only: /* * Feh * * 1 * ^ tab here * 2 * ^ ^ and here * 3 * 4 */ int main() { printf("hello world!\n"); while (true) { for (int i = 0; i < 10; ++i) printf("Silly code example says %d\n", i); } } -Antti
Dec 09 2003
next sibling parent reply Antti =?iso-8859-1?Q?Syk=E4ri?= <jsykari gamma.hut.fi> writes:
Seems that the tabs are showing properly in my message, so the problem
obviously lies in individual newsreaders and in educating the users of
such newsreaders to indent their code with spaces.

I realize that if there was an easy solution, it would have been done
already... Sorry for taking your time.

-Antti

In article <slrnbtdkn7.5fp.jsykari pulu.hut.fi>, Antti Sykäri wrote:
 A thing that's been annoying me for a long time...
 
 Quite a lot of messages in this newsgroup seem to have had their TAB
 characters stripped.  Which, obviously, makes tab-indented code examples
 rather difficult to read.  I'm skipping the longer and more complicated
 code examples just because I'm just too lazy to read code that isn't
 indented properly.
 
 Is it a problem in the news server (if so, could it possibly be
 configured away) or in some individual newsreader?
 
 Example:
 
 int main( char [] [] args ) { 
 int i;
 i = 0;
 while ( i < 2000 ) 
 {
 i++
 printf((*wchar i))
 
 } 
 printf("blah blaha";) 
 printf("Hello lewis !");
 return 0;
 }

Hmm... I never used tabs but let's try for this time only: /* * Feh * * 1 * ^ tab here * 2 * ^ ^ and here * 3 * 4 */ int main() { printf("hello world!\n"); while (true) { for (int i = 0; i < 10; ++i) printf("Silly code example says %d\n", i); } } -Antti

Dec 09 2003
next sibling parent Juan C. <Juan_member pathlink.com> writes:
Indeed that looks good here too. But I _never_ use TABs, they're evil.


In article <slrnbtdl2r.5fp.jsykari pulu.hut.fi>, Antti =?iso-8859-1?Q?Syk=E4ri?=
says...
Seems that the tabs are showing properly in my message, so the problem
obviously lies in individual newsreaders and in educating the users of
such newsreaders to indent their code with spaces.

I realize that if there was an easy solution, it would have been done
already... Sorry for taking your time.

-Antti

In article <slrnbtdkn7.5fp.jsykari pulu.hut.fi>, Antti Sykäri wrote:
 A thing that's been annoying me for a long time...
 
 Quite a lot of messages in this newsgroup seem to have had their TAB
 characters stripped.  Which, obviously, makes tab-indented code examples
 rather difficult to read.  I'm skipping the longer and more complicated
 code examples just because I'm just too lazy to read code that isn't
 indented properly.
 
 Is it a problem in the news server (if so, could it possibly be
 configured away) or in some individual newsreader?
 
 Example:
 
 int main( char [] [] args ) { 
 int i;
 i = 0;
 while ( i < 2000 ) 
 {
 i++
 printf((*wchar i))
 
 } 
 printf("blah blaha";) 
 printf("Hello lewis !");
 return 0;
 }

Hmm... I never used tabs but let's try for this time only: /* * Feh * * 1 * ^ tab here * 2 * ^ ^ and here * 3 * 4 */ int main() { printf("hello world!\n"); while (true) { for (int i = 0; i < 10; ++i) printf("Silly code example says %d\n", i); } } -Antti


Dec 10 2003
prev sibling parent reply "Matthew Wilson" <matthew.hat stlsoft.dot.org> writes:
If anyone's got Perl installed (if not, it's free from www.activestate.com),
feel free to use the tabify.pl and untabify.pl scripts available from
http://synsoft.org/perl.html

"Antti Sykäri" <jsykari gamma.hut.fi> wrote in message
news:slrnbtdl2r.5fp.jsykari pulu.hut.fi...
 Seems that the tabs are showing properly in my message, so the problem
 obviously lies in individual newsreaders and in educating the users of
 such newsreaders to indent their code with spaces.

 I realize that if there was an easy solution, it would have been done
 already... Sorry for taking your time.

 -Antti

 In article <slrnbtdkn7.5fp.jsykari pulu.hut.fi>, Antti Sykäri wrote:
 A thing that's been annoying me for a long time...

 Quite a lot of messages in this newsgroup seem to have had their TAB
 characters stripped.  Which, obviously, makes tab-indented code examples
 rather difficult to read.  I'm skipping the longer and more complicated
 code examples just because I'm just too lazy to read code that isn't
 indented properly.

 Is it a problem in the news server (if so, could it possibly be
 configured away) or in some individual newsreader?

 Example:

 int main( char [] [] args ) {
 int i;
 i = 0;
 while ( i < 2000 )
 {
 i++
 printf((*wchar i))

 }
 printf("blah blaha";)
 printf("Hello lewis !");
 return 0;
 }

Hmm... I never used tabs but let's try for this time only: /* * Feh * * 1 * ^ tab here * 2 * ^ ^ and here * 3 * 4 */ int main() { printf("hello world!\n"); while (true) { for (int i = 0; i < 10; ++i) printf("Silly code example says %d\n", i); } } -Antti


Dec 10 2003
parent "Charles Sanders" <sanders-consulting comcast.net> writes:
<emacs plug>
M-x untabify
</emasc plug>

It also has MUA built in !

C

"Matthew Wilson" <matthew.hat stlsoft.dot.org> wrote in message
news:br87g7$22m5$1 digitaldaemon.com...
 If anyone's got Perl installed (if not, it's free from

 feel free to use the tabify.pl and untabify.pl scripts available from
 http://synsoft.org/perl.html

 "Antti Sykäri" <jsykari gamma.hut.fi> wrote in message
 news:slrnbtdl2r.5fp.jsykari pulu.hut.fi...
 Seems that the tabs are showing properly in my message, so the problem
 obviously lies in individual newsreaders and in educating the users of
 such newsreaders to indent their code with spaces.

 I realize that if there was an easy solution, it would have been done
 already... Sorry for taking your time.

 -Antti

 In article <slrnbtdkn7.5fp.jsykari pulu.hut.fi>, Antti Sykäri wrote:
 A thing that's been annoying me for a long time...

 Quite a lot of messages in this newsgroup seem to have had their TAB
 characters stripped.  Which, obviously, makes tab-indented code



 rather difficult to read.  I'm skipping the longer and more



 code examples just because I'm just too lazy to read code that isn't
 indented properly.

 Is it a problem in the news server (if so, could it possibly be
 configured away) or in some individual newsreader?

 Example:

 int main( char [] [] args ) {
 int i;
 i = 0;
 while ( i < 2000 )
 {
 i++
 printf((*wchar i))

 }
 printf("blah blaha";)
 printf("Hello lewis !");
 return 0;
 }

Hmm... I never used tabs but let's try for this time only: /* * Feh * * 1 * ^ tab here * 2 * ^ ^ and here * 3 * 4 */ int main() { printf("hello world!\n"); while (true) { for (int i = 0; i < 10; ++i) printf("Silly code example says %d\n", i); } } -Antti



Dec 10 2003
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Antti Sykäri" <jsykari gamma.hut.fi> wrote in message
news:slrnbtdkn7.5fp.jsykari pulu.hut.fi...
 Quite a lot of messages in this newsgroup seem to have had their TAB
 characters stripped.  Which, obviously, makes tab-indented code examples
 rather difficult to read.  I'm skipping the longer and more complicated
 code examples just because I'm just too lazy to read code that isn't
 indented properly.

Usually, the first thing I do with a bug report is reformat it into something intellible. By now I've seen every indenting style on the planet, including reverse indenting, and they're all wrong because they're not the one I use <g>.
Dec 10 2003
parent reply Lewis <dethbomb hotmail.com> writes:
Walter wrote:
 "Antti Sykäri" <jsykari gamma.hut.fi> wrote in message
 news:slrnbtdkn7.5fp.jsykari pulu.hut.fi...
 
Quite a lot of messages in this newsgroup seem to have had their TAB
characters stripped.  Which, obviously, makes tab-indented code examples
rather difficult to read.  I'm skipping the longer and more complicated
code examples just because I'm just too lazy to read code that isn't
indented properly.

Usually, the first thing I do with a bug report is reformat it into something intellible. By now I've seen every indenting style on the planet, including reverse indenting, and they're all wrong because they're not the one I use <g>.

using the web based news reader strips tabs from your code
Dec 10 2003
parent reply Ant <Ant_member pathlink.com> writes:
In article <br90bu$6po$1 digitaldaemon.com>, Lewis says...

using the web based news reader strips tabs from your code

do ". printf" instead of " printf" result: printf printf Ant
Dec 11 2003
parent Lewis <dethbomb hotmail.com> writes:
Ant wrote:
 In article <br90bu$6po$1 digitaldaemon.com>, Lewis says...
 
 
using the web based news reader strips tabs from your code

do ". printf" instead of " printf" result: printf printf Ant

ive switched to using the mozilla newsreader, so hopefull wont have that problem anymore :) thanks for the tip...
Dec 11 2003