[GCC 15] Zero-sized array errors in wayland protocol sources #12218
-
|
Context While compiling Hyprland on GCC 15 (Ubuntu 25.10 ARM64), I ran into multiple build errors due to zero-sized arrays in the generated Wayland protocol sources under protocols/. These files are generated automatically by wayland-scanner. Earlier, GCC 13 and 14 treated these lines as mere warnings, but, GCC 15 now treats these empty [] definitions as errors instead of warnings. Example error protocols/wayland.cpp:123:13: error: ISO C++ forbids zero-size arrays [-Wpedantic] Temporary Workaround uint8_t data[1]; or uint8_t data[nullptr]; in all affected files allows the build to complete successfully. System details OS: Ubuntu 25.10 (Questing Quokka) ARM64 Compiler: GCC 15.2.0 Build system: CMake + Ninja Repo branch: main Suggestion Since these files are generated by wayland-scanner, it might make sense to: Adjust Hyprland’s CMake generation step, or Add a small post-processing patch replacing [] with [1] or [nullptr] after the scanner runs. TL;DR GCC 15 disallows zero-length arrays in auto-generated protocol C++ sources. Would the maintainers prefer I open a PR with a small CMake post-processing patch for this? Thanks 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Isn't that fixed in hyprwayland-scanner 0.4.5? |
Beta Was this translation helpful? Give feedback.
Isn't that fixed in hyprwayland-scanner 0.4.5?