www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2970] New: shared variables and std.stdio.writefln

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2970

           Summary: shared variables and std.stdio.writefln
           Product: D
           Version: 2.030
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: echochamber gmail.com


Not sure if this is Phobos issue or DMD issue, but anyway...
std.stdio.writefln doesn't accept 'shared' variables correctly.

% cat shared.d
import std.stdio;

int a = 0;
shared int b = 0;

void main()
{
    writefln("a = [%d], b = [%d]", a, b);

    a = 42;
    b = 42;
    writefln("a = [%d], b = [%d]", a, b);
}
% dmd shared.d && ./shared
a = [0], b = []
a = [42], b = [*]
%

Note: '*' == chr(42)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 12 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2970


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



02:20:25 PDT ---
Fixed dmd 2.033

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 06 2009