Thread overview
[Issue 2980] New: compiler error when writefln( uint )
May 14, 2009
someanon@yahoo.com
May 15, 2009
Walter Bright
May 15, 2009
Brad Roberts
May 14, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2980

           Summary: compiler error when writefln( uint )
           Product: D
           Version: 2.030
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: someanon@yahoo.com


import std.stdio;

int main() {
  uint ui;
  writefln(ui);
  return 0;
}

dmd error out:
$ dmd structarr.d
/home/zhou/project/dmd/linux/bin/../../src/phobos/std/stdio.d(518): Error:
template std.format.formattedWrite(Writer,F,A...) does not match any function
template declaration
/home/zhou/project/dmd/linux/bin/../../src/phobos/std/stdio.d(518): Error:
template std.format.formattedWrite(Writer,F,A...) cannot deduce template
function from argument types !()(LockingTextWriter,uint)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 15, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2980


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #1 from Walter Bright <bugzilla@digitalmars.com>  2009-05-14 20:21:12 PDT ---
writefln() expects a format string as its first argument, not a uint. To print
a value without using a format string, use writeln().

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 15, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2980


Brad Roberts <braddr@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |braddr@puremagic.com
         Resolution|INVALID                     |
         AssignedTo|bugzilla@digitalmars.com    |andrei@metalanguage.com
           Severity|normal                      |enhancement




--- Comment #2 from Brad Roberts <braddr@puremagic.com>  2009-05-14 20:42:48 PDT ---
reopening and turning into an enhancement request.  The writefln templates could do considerably better about messaging the problem.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 15, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2980





--- Comment #3 from Andrei Alexandrescu <andrei@metalanguage.com>  2009-05-14 22:19:55 PDT ---
(In reply to comment #2)
> reopening and turning into an enhancement request.  The writefln templates could do considerably better about messaging the problem.

Yah, I changed things such that now you'll see:

/home/andrei/code/dmd/phobos/std/stdio.d(512): Error: static assert  "You must pass a formatting string as the first argument to writef or writefln. If no formatting is needed, you may want to use write."

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 27, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2980


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




--- Comment #4 from Andrei Alexandrescu <andrei@metalanguage.com>  2009-08-27 14:41:02 PDT ---
Time to close this fella.

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