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

Fix gnu folding constant #84341

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

thughes
Copy link
Contributor

@thughes thughes commented Jan 21, 2025

When building with clang it warns:

    tests/kernel/common/src/pow2.c:30:6: error: variable length array folded
    to constant array as an extension [-Werror,-Wgnu-folding-constant]
    char static_array1[Z_POW2_CEIL(1)];
         ^

We want the variable length array folded into a constant array, so disable the warning.

Depends on #84063

These macros allow disabling compiler warnings for all compilers or only
gcc or only clang.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
When building with clang it warns:

tests/kernel/common/src/pow2.c:30:6: error: variable length array folded
to constant array as an extension [-Werror,-Wgnu-folding-constant]
char static_array1[Z_POW2_CEIL(1)];
     ^

We want the variable length array folded into a constant
array, so disable the warning.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
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 this pull request may close these issues.

1 participant