xcsp3team / XCSP3-CPP-Parser

XCSP3 Core Parser in C++
MIT License
19 stars 11 forks source link

Warnings for unused arguments in callbacks methods #25

Closed massimomorara closed 4 years ago

massimomorara commented 4 years ago

Again: I strongly suggest the systematic use of "-Wall -Wextra -ansi -pedantic".

To avoid the resulting warnings, in 2017 I've proposed some changes and, in particular, the deletion of the identifiers of the unused arguments in funcions/methods declaration.

Unfortunately, the names of the unused arguments is important in "include/XCSP3CoreCallbacks.h" to understand the callbacks.

So I propose another strategy: instructions of type

(void)unusedArgument;

in the body of methods.

Esample: instead of

    virtual void beginInstance(InstanceType type) { }

I propose

    virtual void beginInstance(InstanceType type) { (void)type; }

I add a zip file with a modified "include/XCSPCoreCallbacks.h" with all (void)variable; required.

callbacks-h.zip

xcsp3team commented 4 years ago

Many thanks. Fixed.