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

Build failure with Clang 18 #364

Closed
ziyao233 opened this issue Sep 26, 2024 · 0 comments · Fixed by #365
Closed

Build failure with Clang 18 #364

ziyao233 opened this issue Sep 26, 2024 · 0 comments · Fixed by #365

Comments

@ziyao233
Copy link
Contributor

Building with clang 18, with following steps on master,

meson setup . build
meson compile -C build

results in error like

../libcomposefs/lcfs-fsverity.h:20:32: warning: redefinition of typedef 'FsVerityContext' is a C11 feature [-Wtypedef-redefinition]
   20 | typedef struct FsVerityContext FsVerityContext;
      |                                ^
../libcomposefs/lcfs-internal.h:33:10: note: '../libcomposefs/lcfs-fsverity.h' included multiple times, additional include site here
   33 | #include "lcfs-fsverity.h"
      |          ^
../libcomposefs/lcfs-writer-erofs.c:24:10: note: '../libcomposefs/lcfs-fsverity.h' included multiple times, additional include site here
   24 | #include "lcfs-fsverity.h"
      |          ^
../libcomposefs/lcfs-fsverity.h:20:32: note: unguarded header; consider using #ifdef guards or #pragma once
   20 | typedef struct FsVerityContext FsVerityContext;
      |                                ^
../libcomposefs/lcfs-writer-erofs.c:1618:2: error: call to undeclared function 'static_assert'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 1618 |         static_assert((sizeof(struct erofs_xattr_ibody_header) == LCFS_XATTR_HEADER_SIZE),
      |         ^
1 warning and 1 error generated.

it seems that some C11 features are used, but c_std=c99 is specified in meson.build1, which should be fixed.

ziyao233 added a commit to ziyao233/composefs that referenced this issue Sep 26, 2024
Some C11 features have been used, but meson.build still specifies
c_std=c99, leading to errors on Clang compiler.

Fixes: containers#364
Signed-off-by: Yao Zi <[email protected]>
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.

1 participant