Comment #0 by bearophile_hugs — 2010-10-30T15:19:48Z
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.htmlhttp://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 ).
Comment #1 by lt.infiltrator — 2015-12-09T10:20:32Z
I don't know whether it's necessary to add another class of compiler messages. It might be enough to just make these warnings. It would be helpful especially useful for @nogc.
Comment #2 by bearophile_hugs — 2015-12-09T12:54:02Z
(In reply to Infiltrator from comment #1)
> I don't know whether it's necessary to add another class of compiler
> messages. It might be enough to just make these warnings. It would be
> helpful especially useful for @nogc.
Warnings are meant to warn you against something. Compiler tips are more like suggestions (but it's not an essential difference, I agree. What's important is to produce some message). The compilers of other good languages have such kind of messages, so they can be good for D too.
Comment #3 by andrei — 2016-10-14T13:36:04Z
I'll mark this as a dupe of 5051 because tips could be a part of that tool.
*** This issue has been marked as a duplicate of issue 5051 ***