Closed thradams closed 8 months ago
For completeness I propose to also add pedantic
as a more strict mode.
the idea is to let user create the sets..using pragma
#pragma warning set "pedantic" "w1, w2"
or
#define PEDANTIC "w1, w2" //then expand inside pragma (that is uncommon)
then warnings can be set in groups.
for instance (something like, the design is open..)
#pragma warning push "pedantic"
#pragma warning pop
same as
#pragma warning push "w1, w2"
#pragma warning pop
We also need a way to inform if the message is error warning or note.
#pragma warning set "pedantic" "w123, e124, n125"
then 123 is the number of name and w means show as warning, e show as error and n show as note.
Also a way to remove the message from the context. It can be minus sign.
#pragma warning set "no-ownwership-checks" "-241, -454"
#pragma warning push "no-ownwership-checks"
//
#pragma warning pop
void F(int i);
_Owner int make();
int main()
{
F(make());
#pragma cake diagnostic check "-Wnon-owner-move"
}
new pragma added for unit test.if the last diagnostic is the one informed then the error ir cleared. otherwise an error is added. at the end with this pragma unit test must return no errors. all unit tests must use this.
but then we have two ways; static_state will no work in preprocessor.
implemented like GCC the only difference is ignore note , that is something below warning.
The idea is to create the concept of diagnostic. User will decide if a message will be an error, warning or note. Se have 3 sets. error,warning, note
if the diagnostic message is not on any of these sets, that means the message is ignored.