felixguendling / cista

Cista is a simple, high-performance, zero-copy C++ serialization & reflection library.
https://cista.rocks
MIT License
1.78k stars 113 forks source link

Silence clang specific #pragma directives for other compilers ? #173

Closed AdelKS closed 1 year ago

AdelKS commented 1 year ago

Hello !

The latest version of cista introduced some compile time warnings on GCC

cista/containers/mutable_fws_multimap.h:55: warning: ignoring ‘#pragma clang diagnostic’ [-Wunknown-pragmas]
   55 | #pragma clang diagnostic ignored "-Wclass-conversion"

Do you think there's a way to not make it complain?

felixguendling commented 1 year ago

Does it help to wrap it with #ifdef __clang__ like here? https://github.com/felixguendling/cista/blob/48c47ac007dfebf549ed0857ad8fe8a03c05e6a0/include/cista/reflection/arity.h#L30-L45

AdelKS commented 1 year ago

I haven't used clang yet to see if it complains but I think that should work for gcc. You can't reproduce the warnings locally? I get them with with -Wall -Wextra flags, I wonder how different the actual set of flags that get activated differ from the ones cista activates 🤔