User forums > Nightly builds

The 05 march 2006 build is out.

<< < (2/4) > >>

Zingam:
No its not correct :) That's why it crashes!

Zingam:

--- Code: ---import std.stdio;

void main()
{
    char[] ch = "now";


        writefln("\ncrash  %s  ", ch, 333 );
    }
    writefln("\ncrash   %d", ch, 333 );
}

--- End code ---

The above doesn't crash Code::Blocks.

It seems it crashes when there are two: %


This does not cause a crash:

--- Code: ---import std.stdio;
void main()
{
    char[] ch = "now";


        writefln("\ncrash  %s  ", ch, 333 );
    }
    writefln("\ncrash   %d %d", ch, 333 );
}

--- End code ---

console output:
--- Code: ---E:\Home\Hristo\My Documents\CodeBlocks Projects\D Crash>dmd main.d
main.d(11): found '"\x0acrash   %d %d"' when expecting ')'
main.d(11): no identifier for declarator writefln
main.d(11): no identifier for declarator writefln
main.d(11): semicolon expected, not '333'
main.d(11): Declaration expected, not '333'
main.d(12): unrecognized declaration
--- End code ---

but this does:

--- Code: ---import std.stdio;

void main()
{
    char[] ch = "now";


        writefln("\ncrash  %s  ", ch, 333 );
    }
    writefln("\ncrash   %s %d", ch, 333 );
}

--- End code ---

Note the "%s".

This is the console output when I run the compiler from the command prompt:

--- Code: ---main.d(11): found '"\x0acrash   %s %d"' when expecting ')'
main.d(11): no identifier for declarator writefln
main.d(11): no identifier for declarator writefln
main.d(11): semicolon expected, not '333'
main.d(11): Declaration expected, not '333'
main.d(12): unrecognized declaration
--- End code ---


sethjackson:

--- Quote from: Zingam on March 06, 2006, 12:26:54 am ---No its not correct :) That's why it crashes!

--- End quote ---

 :lol:  :oops:

As to the second post. Interesting.....  :?

sethjackson:
I don't have D on my system, but I do have GCC.


--- Code: (cpp) ---#include <stdio.h>
#include <stdlib.h>

int main()
{
    char ch[] = "now";

    printf("crash %s %d", ch, 333);
}


--- End code ---

No crash. I'm not sure if it is equivalent or not, but it doesn't crash C::B.....

Zingam:

--- Code: ---#include <stdio.h>
#include <stdlib.h>

int main()
{
    char ch[] = "now";

    printf("crash  %s", ch, 333);
    }
    printf("crash %s %d", ch, 333);
}

--- End code ---

This doesn't cause a crash.

And that's from when CB crashes:


--- Quote ---Unhandled exception at 0x00000000 in codeblocks.exe: 0xC0000005: Access violation reading location 0x0000000c.

Unhandled exception at 0xb25374ba in codeblocks.exe: 0xC0000005: Access violation reading location 0xb25374ba.
--- End quote ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version