www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5490] New: DMDFE: Slim down warnings generated by GCC

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

           Summary: DMDFE: Slim down warnings generated by GCC
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: ibuclaw ubuntu.com


--- Comment #0 from Iain Buclaw <ibuclaw ubuntu.com> 2011-01-26 09:03:22 PST ---
When building DMDFE with warnings enabled (-W -Wall -Wcast-qual), there are
literally thousands of messages emitted (most notably seen when building GDC).

Putting default statements at the end of switches cuts the amount down by at
least 3 quarters.

See patch against the 1.066 release.

Regards

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 26 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490



--- Comment #1 from Iain Buclaw <ibuclaw ubuntu.com> 2011-01-26 09:04:49 PST ---
Created an attachment (id=883)
fix most notorious warnings in dmdfe

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 26 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490



--- Comment #2 from Iain Buclaw <ibuclaw ubuntu.com> 2011-02-10 15:01:12 PST ---
Created an attachment (id=902)
ambiguous 'else' patch

Patch for D2FE: suggest explicit braces to avoid ambiguous 'else'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 10 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490



--- Comment #3 from Iain Buclaw <ibuclaw ubuntu.com> 2011-02-10 15:03:39 PST ---
Created an attachment (id=903)
always false patch

Patch for D2FE: comparison of unsigned expression < 0 is always false

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 10 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490



--- Comment #4 from Iain Buclaw <ibuclaw ubuntu.com> 2011-02-10 15:06:37 PST ---
Created an attachment (id=904)
defined not used patch

Patch for D2FE: ‘zero’ defined but not used

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 10 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc


--- Comment #5 from bearophile_hugs eml.cc 2011-02-10 15:08:33 PST ---
Wonderful! See bugs 4375 and bug 5539

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 10 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490



--- Comment #6 from Iain Buclaw <ibuclaw ubuntu.com> 2011-02-10 15:19:39 PST ---
Created an attachment (id=905)
unused parm header patch

Patch for D2FE: 'unused parameter' emitted from headers.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 10 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490



--- Comment #7 from Iain Buclaw <ibuclaw ubuntu.com> 2011-02-10 15:24:21 PST ---
Created an attachment (id=906)
unhandled enum patch

Patch for D2FE: enumeration value not handled in switch

(Last in small batch, and largest of the lot).

Regards, and G'night.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 10 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490



--- Comment #8 from Iain Buclaw <ibuclaw ubuntu.com> 2011-02-10 15:30:21 PST ---
(In reply to comment #5)
 Wonderful! See bugs 4375 and bug 5539
These just address warnings emitted from GCC when building DMD with '-Wall -Wextra', and don't address actually putting these warnings into DMD itself. To be honest, I'm just tired of seeing thousands of warnings scroll by, makes life very difficult if an actual compiler error occurs. 8-) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 10 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490



--- Comment #9 from bearophile_hugs eml.cc 2011-02-10 15:36:39 PST ---
(In reply to comment #8)
 These just address warnings emitted from GCC when building DMD with '-Wall
 -Wextra', and don't address actually putting these warnings into DMD itself.
I know. Note bug 5539 doesn't ask for a warning, but for an error, so it asks for a change in D2 language itself. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 10 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com


--- Comment #10 from Walter Bright <bugzilla digitalmars.com> 2011-02-11
00:52:59 PST ---
I should note that none of these are actual bugs.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 11 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490



--- Comment #11 from bearophile_hugs eml.cc 2011-02-11 03:05:12 PST ---
(In reply to comment #10)
 I should note that none of these are actual bugs.
There is an interesting paper about the topic, "Using Redundancies to Find Errors" by Yichen Xie and Dawson Engle: http://www.stanford.edu/~engler/p401-xie.pdf The Abstract: "This paper explores the idea that redundant operations, like type errors, commonly fag correctness errors. We experimentally test this idea by writing and applying four redundancy checkers to the Linux operating system, finding many errors. We then use these errors to demonstrate that redundancies, even when harmless, strongly correlate with the presence of traditional hard errors (e.g., null pointer dereferences, unreleased locks). Finally we show that how flagging redundant operations gives a way to make specifications fail stop by detecting dangerous omissions." This for example applies to things like unsigned<0. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 11 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5490



--- Comment #12 from Iain Buclaw <ibuclaw ubuntu.com> 2011-05-06 16:10:49 PDT
---
GCC-4.6 offers two new warning switches to catch redundant code:
-Wunused-but-set-parameter and -Wunused-but-set-variable

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