brainboxdotcc / DPP

C++ Discord API Bot Library - D++ is Lightweight and scalable for small and huge bots!
https://dpp.dev/
Apache License 2.0
1.05k stars 159 forks source link

fix: compilation on clang-19 #1195

Closed ruslan-ilesik closed 2 months ago

ruslan-ilesik commented 2 months ago

Code change checklist

Unable to test voice because of broken unit test for voice send.

Replaced std::basic_string with std::vector

Fix for issue 1129

netlify[bot] commented 2 months ago

Deploy Preview for dpp-dev ready!

Name Link
Latest commit 276714e1332b2e0f54f089f0c49bf05d43a377d5
Latest deploy log https://app.netlify.com/sites/dpp-dev/deploys/668d131afdc85500083d8cb4
Deploy Preview https://deploy-preview-1195--dpp-dev.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

braindigitalis commented 2 months ago

this compiles but have you checked that it works? seems like quite a big change.

ruslan-ilesik commented 2 months ago

this compiles but have you checked that it works? seems like quite a big change.

No, I did not yet, I will try to run one of our examples bots tomorrow on this version of build

ruslan-ilesik commented 2 months ago

Okay, just checked it using https://dpp.dev/stream-mp3-discord-bot.html Works fine. Also ran code using valgrind, and played song multiple times

==19411== Process terminating with default action of signal 2 (SIGINT) ==19411== at 0x67D7117: futex_abstimed_wait_common64 (futex-internal.c:57) ==19411== by 0x67D7117: __futex_abstimed_wait_common (futex-internal.c:87) ==19411== by 0x67D7117: futex_abstimed_wait_cancelable64 (futex-internal.c:139) ==19411== by 0x67D9A40: pthread_cond_wait_common (pthread_cond_wait.c:503) ==19411== by 0x67D9A40: pthread_cond_wait@@GLIBC_2.3.2 (pthread_cond_wait.c:627) ==19411== by 0x655390E: std::1::condition_variable::wait(std::__1::unique_lock&) (in /usr/lib/llvm-19/lib/libc++.so.1.0) ==19411== by 0x5AEFC70: dpp::cluster::start(bool)::$_1::operator()() const (in /usr/local/lib/libdpp.so.10.0.31) ==19411== by 0x5AEFB8E: dpp::cluster::start(bool) (in /usr/local/lib/libdpp.so.10.0.31) ==19411== by 0x112D6D: main (in /home/ilesik/test/a.out) ==19411== ==19411== HEAP SUMMARY: ==19411== in use at exit: 18,821,403 bytes in 9,732 blocks ==19411== total heap usage: 72,243 allocs, 62,511 frees, 98,628,767 bytes allocated ==19411== ==19411== LEAK SUMMARY: ==19411== definitely lost: 0 bytes in 0 blocks ==19411== indirectly lost: 0 bytes in 0 blocks ==19411== possibly lost: 8,064 bytes in 19 blocks ==19411== still reachable: 18,813,339 bytes in 9,713 blocks ==19411== suppressed: 0 bytes in 0 blocks ==19411== Rerun with --leak-check=full to see details of leaked memory ==19411== ==19411== For lists of detected and suppressed errors, rerun with: -s ==19411== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

ruslan-ilesik commented 2 months ago

not sure this is right please check it works

Also, additionally I ran a voice record bot we have, was working just fine (just to double check)

braindigitalis commented 2 months ago

can you please fix the codacy issue by moving the [[maybe_unused]] before the const in the if()

ruslan-ilesik commented 2 months ago

can you please fix the codacy issue by moving the [[maybe_unused]] before the const in the if()

How can i do it? This variable was there before my changes, Should i just remove it?