Building Genesis4 clued me into a bug in the master branch, a memory leak of 3 arrays in Wake.cpp post-init():
2023-12-04T23:03:48.8335470Z /Users/runner/Miniforge3/conda-bld/genesis4_1701730808588/work/src/Main/Wake.cpp:120:20: warning: left operand of comma operator has no effect [-Wunused-value]
2023-12-04T23:03:48.8434770Z delete[] wakeres,wakegeo,wakerou,wakeext;
2023-12-04T23:03:48.8535100Z ^~~~~~~
2023-12-04T23:03:48.8592490Z /Users/runner/Miniforge3/conda-bld/genesis4_1701730808588/work/src/Main/Wake.cpp:120:28: warning: left operand of comma operator has no effect [-Wunused-value]
2023-12-04T23:03:48.8695580Z delete[] wakeres,wakegeo,wakerou,wakeext;
2023-12-04T23:03:48.8743960Z ^~~~~~~
2023-12-04T23:03:48.8843570Z /Users/runner/Miniforge3/conda-bld/genesis4_1701730808588/work/src/Main/Wake.cpp:120:36: warning: expression result unused [-Wunused-value]
2023-12-04T23:03:48.8919660Z delete[] wakeres,wakegeo,wakerou,wakeext;
2023-12-04T23:03:48.9011940Z ^~~~~~~
The delete [] a, b, c, d syntax in actuality only deletes a, as the comma is not separating arguments to delete[] but rather is functioning as the comma operator.
There are a number of examples of this on the Internet (example) so you're not alone in thinking this was valid. Clang is the only one that reported the warning in my testing.
Building Genesis4 clued me into a bug in the master branch, a memory leak of 3 arrays in
Wake.cpp
post-init()
:The
delete [] a, b, c, d
syntax in actuality only deletesa
, as the comma is not separating arguments todelete[]
but rather is functioning as the comma operator. There are a number of examples of this on the Internet (example) so you're not alone in thinking this was valid. Clang is the only one that reported the warning in my testing.(cc @ChristopherMayes )