Celtoys / Remotery

Single C file, Realtime CPU/GPU Profiler with Remote Web Viewer
Apache License 2.0
3.03k stars 255 forks source link

Moved potential side effect from assert() #232

Closed JCash closed 1 year ago

dwilliamson commented 1 year ago

Any updates on this?

JCash commented 1 year ago

Hmm, not sure what you mean?

I think it's a good rule of thumb to not include code with side effects in the assert macros, as they are removed when compiling with NDEBUG. Although it may not be actually crucial in this case, it sets an example to others to not do it either.

Edit: Ofc, if the intent was to actually remove the code when using NDEBUG, we could add a comment instead, to make it clear.

dwilliamson commented 1 year ago

The use of (void)r to notify a potentially unused parameter is not compatible across compilers. That's where we can use RMT_UNREFERENCED_PARAMETER(r).