Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.7.2
-
None
Description
MOC auto-generated codes don't play nice with Clang's `-Wunsafe-buffer-usage` / `-Werror=unsafe-buffer-usage`.
this is the header:
```cpp
#include <QWindow>
class VulkanWindow : public QWindow
{
Q_OBJECT
public:
VulkanWindow(QWindow *parent = nullptr)
: QWindow(parent)
{}
void closeEvent(QCloseEvent *event) override
{ emit windowClosed(); QWindow::closeEvent(event); }signals:
void windowClosed();
};
```
This is the compile time error:
In file included from project/build/Desktop_Qt_6_7_2-Debug/main_autogen/mocs_compilation.cpp:2:
project/build/Desktop_Qt_6_7_2-Debug/main_autogen/UVLADIE3JM/moc_vulkanwindow.cpp:84:90: error: '_a' is an unsafe pointer used for buffer access [-Werror,-Wunsafe-buffer-usage]
84 | void VulkanWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
~~~~~~^
project/build/Desktop_Qt_6_7_2-Debug/main_autogen/UVLADIE3JM/moc_vulkanwindow.cpp:97:85: note: used in buffer access here
97if (_t _q_method = &VulkanWindow::windowClosed; *reinterpret_cast<_t *>(_a[1]) == _q_method) { ^~
1 error generated.
(yeah i can't figure out how to properly format. why is markdown not supported?)