storaged-project / libblockdev

A library for manipulating block devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

plugins/fs/generic.c fails to build with clang - invalid C

q66 opened this issue · comments

commented

Initializers like .mkfs_options = fs_features[BD_FS_TECH_EXT2].mkfs, are not well defined C, as the designated initializer at file scope is required to be a constant expression. GCC accepts it, clang does not.

commented

quick workaround for reference: https://github.com/chimera-linux/cports/blob/master/main/libblockdev/patches/constant-init.patch

but a proper fix should probably involve moving the expressions under common macros so that they do not have to be repeated

Hmm, yeah, this is unfortunate, thanks for pointing this out.