[Issue 5137] New: Compiler tips

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 30 15:20:44 PDT 2010


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

           Summary: Compiler tips
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2010-10-30 15:19:48 PDT ---
A third class of compiler messages, beside the warnings and the errors are
"tips". They aren't sure errors or possible errors, they are situations where
for example the compiler suggests possible performance improvements or where
the programmer may add more constraints to the functions.

See bug 5056 , bug 5070

Another example is from a feature added to GCC 4.6:
http://gcc.gnu.org/gcc-4.6/changes.html
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#Warning-Options

-Wsuggest-attribute=pure
-Wsuggest-attribute=const
-Wsuggest-attribute=noreturn

This shows tips where that attribute may be added to the code.

Another example: the compiler may suggest cases where using an Appender may be
used instead of many normal array appends.

Another possible compiler tip is to optionally list all points where a very
large fixed-sized array is passed by value (see bug 4580 ).

-- 
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