wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
8.61k stars 592 forks source link

Tracy 0.10: build failure due to assignment of read-only member #802

Closed fjebaker closed 1 month ago

fjebaker commented 1 month ago

I was trying to build the profiler on my laptop:

git clone "https://github.com/wolfpld/tracy/" && cd tracy
git checkout v0.10
cd profiler/build/unix
make -j release

but I hit this error, killing the build:

../../../server/../dtl/Diff.hpp: In member function ‘void dtl::Diff<elem, sequence, comparator>::enableTrivial() const’:
../../../server/../dtl/Diff.hpp:168:27: error: assignment of member ‘trivial’ in read-only object
  168 |             this->trivial = true;
      |             ~~~~~~~~~~~~~~^~~~~~

Looking at the source code on that line:

        void enableTrivial () const {
            this->trivial = true;
        }

This shouldn't be const as it's mutating, right? Removing the annotation makes it compile (and run) fine.

Setup

~ $ gcc --version
gcc (GCC) 14.1.1 20240522
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

~ $ uname -a
Linux tamburlaine 6.9.2-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 26 May 2024 01:30:29 +0000 x86_64 GNU/Linux
fjebaker commented 1 month ago

Oh whoops I see it's already fixed in the main branch! Closing as redundant.