[Issue 5413] New: (diagnostic): No notification that warnings are treated as errors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 5 07:29:36 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5413

           Summary: (diagnostic): No notification that warnings are
                    treated as errors
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: ibuclaw at ubuntu.com


--- Comment #0 from Iain Buclaw <ibuclaw at ubuntu.com> 2011-01-05 07:27:20 PST ---
Not a bug, just a diagnostic suggestion.

When compiling with warnings turned on, there is no visual output suggesting
whether or not that warning is ignored or enforced as an error:


ie:
int main()
{
    return 0;
    return 1;
}

$ dmd test.d -w
test.d(4): Warning: statement is not reachable
$ dmd test.d -wi
test.d(4): Warning: statement is not reachable


Would be handy if confronted with a notification that warnings are being
treated as errors by the compiler.

This small addition to vwarning has a nice effect:

     {
         char *p = loc.toChars();

+        if (global.params.warnings == 1)
+            fprintf(stdmsg, "%s: warnings being treated as errors\n",
global.params.argv0);
+
         if (*p)
             fprintf(stdmsg, "%s: ", p);
         mem.free(p);



$ dmd test.d -w
dmd: warnings being treated as errors
test.d(4): Warning: statement is not reachable
$ dmd test.d -wi
test.d(4): Warning: statement is not reachable


Regards

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


More information about the Digitalmars-d-bugs mailing list