mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
The base class thing was an ugly way to get around the lack of C99 compound literals in C++, and also to make the bare ioctls usable with the derived classes. Today, both clang and gcc have C99 compound literals, so there's no need to do crazy things with memset. We never used the derived classes for ioctls, and for this specific ioctl it would have been a very, very bad idea, so there's no need to support that either. We do need to jump through hoops for ostream& operator<<() but we had to do those anyway as there are other members in the derived type. So we can simply drop the base class, and build the args object on the stack in `do_ioctl`. This also removes the need to verify initialization. There's no bug here since the `info` member of the base class was never used in place by the derived class, but new compilers reject the flexible array member in the base class because the derived class makes `info` be not at the end of the struct any more: error: flexible array member btrfs_ioctl_same_args::info not at end of struct crucible::BtrfsExtentSame Fixes: https://github.com/Zygo/bees/issues/232 Signed-off-by: Zygo Blaxell <bees@furryterror.org>