Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
January 24, 2009 [Issue 2613] New: The trivial hello.d sample program fails at execution | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=2613 Summary: The trivial hello.d sample program fails at execution Product: D Version: 2.023 Platform: All OS/Version: All Status: NEW Severity: minor Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: PhiBerthault@Orange.fr The hello.d sample programs shows parasite characters when invoked. The problem comes from missing nul terminating character in D strings. The line: printf("args[%d] = '%s'\n", i, cast(char *)args[i]); must be rewritten as: printf("args[%d] = '%.*s'\n", i, args[i]); There is the same error in the unittest.d program in Phobos. -- |
January 25, 2009 [Issue 2613] The trivial hello.d sample program fails at execution | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2613 smjg@iname.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |smjg@iname.com ------- Comment #1 from smjg@iname.com 2009-01-25 16:25 ------- Wrong again. It should be fixed to use writefln, in both the D1 and D2 packages. And probably have args declared as string[] rather than char[][]. ---------- import std.stdio; int main(string[] args) { writefln("hello world"); writefln("args.length = %d", args.length); for (int i = 0; i < args.length; i++) writefln("args[%d] = '%s'", i, args[i]); return 0; } ---------- -- |
January 25, 2009 [Issue 2613] The trivial hello.d sample program fails at execution | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2613 ------- Comment #2 from braddr@puremagic.com 2009-01-25 16:58 ------- Walter, these sources don't seem to be part of either the phobos or druntime projects, so they must live along side the compiler itself. Over half of them use printf, and I'll bet that most could stand to be updated in one way or another. This applies to both 1.x and 2.x as well. -- |
September 01, 2010 [Issue 2613] The trivial hello.d sample program fails at execution | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2613 AdamB <cruxic@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cruxic@gmail.com --- Comment #3 from AdamB <cruxic@gmail.com> 2010-08-31 21:25:57 PDT --- I'm seeing this problem in D2.0.48 although I only see the garbage characters on Windows. Is this stuff in version control? I'd be glad to rid all the sample programs of printf... -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
August 24, 2011 [Issue 2613] The trivial hello.d sample program fails at execution | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=2613 Vladimir Panteleev <thecybershadow@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |thecybershadow@gmail.com Resolution| |FIXED --- Comment #4 from Vladimir Panteleev <thecybershadow@gmail.com> 2011-08-24 13:30:36 PDT --- This seems to have been fixed for a while now (hello.d uses writefln). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation