cycfi / q

C++ Library for Audio Digital Signal Processing
MIT License
1.12k stars 146 forks source link

Deprecated space in "" operator overloads causes compiler warnings, which causes errors in our release builds #68

Closed reFX-Mike closed 8 months ago

reFX-Mike commented 8 months ago

The file q_lib/include/q/support/literals.hpp contains 18 operator overloads for e.g.

constexpr frequency operator "" _Hz(long double val)

The space between " and _Hztriggers a compiler warning, which in our case leads to a compiler error, since we compile with warnings are errors, to force ourselves to produce clean(er) code.

All operator overloads in that file have that problem. Removing the space fixes it and has no side effects.

djowel commented 8 months ago

What is the warning and which compiler? Can you file a PR so a commit can be tracked to this and you? Thanks!

reFX-Mike commented 8 months ago

Warning is -Wdeprecated-literal-operator

The compiler is llvm/clang 17.0.2

I don't want to create a fork for a single file with only 18 trivial changes. If you remove the space, the warning goes away and compiles cleanly on all compilers. The space in between has been deprecated.

djowel commented 8 months ago

OK, no problem. Thanks for the report!

djowel commented 8 months ago

Fixed in develop branch. I'll merge to master ASAP.