Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build neither under Clang 17.0.6 nor GCC 13.2.0 #1069

Closed
KynikossDragonn opened this issue Mar 20, 2024 · 8 comments · Fixed by #1070
Closed

Cannot build neither under Clang 17.0.6 nor GCC 13.2.0 #1069

KynikossDragonn opened this issue Mar 20, 2024 · 8 comments · Fixed by #1070

Comments

@KynikossDragonn
Copy link

My system is running "Void Linux", kernel 6.6.22_1.

$ clang-17 --version
clang version 17.0.6
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ g++ --version
g++ (GCC) 13.2.0
Copyright (C) 2023 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.

The build fails in Clang with this:

/tmp/SceneSwitcher/deps/websocketpp/websocketpp/common/md5.hpp:201:21: error: performing pointer subtraction with a null pointer may have undefined behavior [-Werror,-Wnull-pointer-subtraction]
  201 |         if (!((data - (md5_byte_t const *)0) & 3)) {
      |                     ^ ~~~~~~~~~~~~~~~~~~~~~

I tried to build with GCC instead and this happens:

/usr/include/c++/13.2/bits/atomic_base.h:481:25: error: 'void __atomic_store_1(volatile void*, unsigned char, int)' writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
  481 |         __atomic_store_n(&_M_i, __i, int(__m));
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
In function 'void advss::StopAndClearAllActionQueues()':
cc1plus: note: destination object is likely at address zero
cc1plus: all warnings being treated as errors

In addition there are troves of compiler warnings about various things (conversion of values, shadows, etc) but other than that I am completely unable to build from the current commit ea17e8e as of writing this issue.

@WarmUpTill
Copy link
Owner

WarmUpTill commented Mar 21, 2024

Thanks for reporting the issue!


Just to clarify:
How exactly are you compiling the plugin?
Are you using the cmake build system?


The first error you encountered with clang is happening in websocketpp.
So a dependency of the plugin.

The second error, which you encountered with GCC, seems to happen in the std lib header itself.

The "fix" for both of these errors is to no longer treat them as an error as both of them are out of my control.
So, adding -Wno-error=stringop-overflow and -Wno-error=null-pointer-subtraction somewhere in the CMakeLists.txt files should help.

I will let you know once I find a suitable place to do this.

@WarmUpTill WarmUpTill linked a pull request Mar 21, 2024 that will close this issue
@WarmUpTill
Copy link
Owner

Can you try building from the ignore-warnings branch?
I added the mentioned compile options which should result in those warnings being ignored.

@KynikossDragonn
Copy link
Author

Yeah, I'm using the CMake system. (I use the CMake GUI program then in a terminal actually run ninja in the out-of-tree build directory I create the CMake files in)

I'm a bit green when it comes to Git, if I clone the entire repo according to your instructions on the wiki, will that let me actually switch to the ignore-warnings branch? Or do I have to specifically clone that branch?

The web socket plugin actually doesn't work in Void Linux's OBS because the way their package system works it cannot successfully build OBS with the browser and websocket plugins. Evidently while there is a template to scavenge the browser source plugin from the Ubuntu deb, there isn't one for the websocket plugin. (Which I can probably make on my end)

@Destroy666x
Copy link
Contributor

Destroy666x commented Mar 21, 2024

You should checkout to the specific branch, e.g. git fetch -> git checkout origin/ignore-warnings. You can also download directly from GH: https://github.com/WarmUpTill/SceneSwitcher/archive/refs/heads/ignore-warnings.zip

@KynikossDragonn
Copy link
Author

Either I'm doing something wrong or it still doesn't build:

In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:23:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-action-variable.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action-variable.hpp:17:7: error: 'PerformAction' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   17 |         bool PerformAction();
      |              ^
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action.hpp:13:15: note: overridden virtual function is here
   13 |         virtual bool PerformAction() = 0;
      |                      ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:23:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-action-variable.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action-variable.hpp:18:7: error: 'Save' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   18 |         bool Save(obs_data_t *obj) const;
      |              ^
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action.hpp:16:15: note: overridden virtual function is here
   16 |         virtual bool Save(obs_data_t *obj) const = 0;
      |                      ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:23:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-action-variable.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action-variable.hpp:19:7: error: 'Load' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   19 |         bool Load(obs_data_t *obj);
      |              ^
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action.hpp:17:15: note: overridden virtual function is here
   17 |         virtual bool Load(obs_data_t *obj) = 0;
      |                      ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:23:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-action-variable.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action-variable.hpp:21:14: error: 'GetShortDesc' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   21 |         std::string GetShortDesc() const;
      |                     ^
/tmp/SceneSwitcher/lib/macro/macro-segment.hpp:34:22: note: overridden virtual function is here
   34 |         virtual std::string GetShortDesc() const;
      |                             ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:23:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-action-variable.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action-variable.hpp:22:14: error: 'GetId' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   22 |         std::string GetId() const { return id; };
      |                     ^
/tmp/SceneSwitcher/lib/macro/macro-segment.hpp:35:22: note: overridden virtual function is here
   35 |         virtual std::string GetId() const = 0;
      |                             ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:23:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-action-variable.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action-variable.hpp:24:31: error: 'Copy' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   24 |         std::shared_ptr<MacroAction> Copy() const;
      |                                      ^
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action.hpp:11:39: note: overridden virtual function is here
   11 |         virtual std::shared_ptr<MacroAction> Copy() const = 0;
      |                                              ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:23:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-action-variable.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action-variable.hpp:27:7: error: 'ResolveVariablesToFixedValues' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   27 |         void ResolveVariablesToFixedValues();
      |              ^
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-action.hpp:20:15: note: overridden virtual function is here
   20 |         virtual void ResolveVariablesToFixedValues();
      |                      ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:25:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-condition-macro.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-condition-macro.hpp:25:7: error: 'CheckCondition' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   25 |         bool CheckCondition();
      |              ^
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-condition.hpp:65:15: note: overridden virtual function is here
   65 |         virtual bool CheckCondition() = 0;
      |                      ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:25:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-condition-macro.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-condition-macro.hpp:26:7: error: 'Save' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   26 |         bool Save(obs_data_t *obj) const;
      |              ^
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-condition.hpp:66:15: note: overridden virtual function is here
   66 |         virtual bool Save(obs_data_t *obj) const = 0;
      |                      ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:25:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-condition-macro.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-condition-macro.hpp:27:7: error: 'Load' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   27 |         bool Load(obs_data_t *obj);
      |              ^
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-condition.hpp:67:15: note: overridden virtual function is here
   67 |         virtual bool Load(obs_data_t *obj) = 0;
      |                      ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:25:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-condition-macro.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-condition-macro.hpp:29:14: error: 'GetShortDesc' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   29 |         std::string GetShortDesc() const;
      |                     ^
/tmp/SceneSwitcher/lib/macro/macro-segment.hpp:34:22: note: overridden virtual function is here
   34 |         virtual std::string GetShortDesc() const;
      |                             ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:25:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-condition-macro.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-condition-macro.hpp:30:14: error: 'GetId' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   30 |         std::string GetId() const { return id; };
      |                     ^
/tmp/SceneSwitcher/lib/macro/macro-segment.hpp:35:22: note: overridden virtual function is here
   35 |         virtual std::string GetId() const = 0;
      |                             ^
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/mocs_compilation.cpp:25:
In file included from /tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/moc_macro-condition-macro.cpp:9:
/tmp/SceneSwitcher/build/advanced-scene-switcher-lib_autogen/DWMXG7BUEP/../../../lib/macro/macro-condition-macro.hpp:71:7: error: 'SetupTempVars' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
   71 |         void SetupTempVars();
      |              ^
/tmp/SceneSwitcher/lib/macro/macro-segment.hpp:47:15: note: overridden virtual function is here
   47 |         virtual void SetupTempVars();
      |                      ^
89 warnings and 13 errors generated.

@WarmUpTill
Copy link
Owner

This is now a different warning.
I might look into fixing that one in particular as this is happening in the advanced scene switcher's code as far as I can tell.

To unblock you I have have pushed another change to the ignore-warnings branch, which should ignore this warning as well.
So after running git pull again it might work. (Unless even more new issues pop up)

I might have to set up a VM and reproduce the issue myself as iterating via GitHub issue comments is a bit too inefficient and unnecessarily takes up time on your end :)

@WarmUpTill
Copy link
Owner

I have merged some changes to the master branch now.
I would appreciate if you could give this another try (whenever you find the time to) as I am running into some issues setting a VM. :)

@KynikossDragonn
Copy link
Author

I will try to build from master branch sometime around the 13th.

Hopefully all this modern compiler mumbo-jumbo isn't too annoying to deal with, I'm not really a coder myself unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants