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

[BUG] better to ban variable length arrays #15572

Open
1 task done
yamt opened this issue Jan 16, 2025 · 2 comments
Open
1 task done

[BUG] better to ban variable length arrays #15572

yamt opened this issue Jan 16, 2025 · 2 comments
Labels
Arch: all Issues that apply to all architectures OS: Mac Issues related to MacOS (building system, etc) Type: Bug Something isn't working

Comments

@yamt
Copy link
Contributor

yamt commented Jan 16, 2025

Description / Steps to reproduce the issue

it seems that we use variable length array (VLA) here and there.
eg.

struct iovec bufs[2 + msg->msg_iovlen];

VLA is a C99 feature and should not be used in the common part of the OS. i guess it's better to add -Wvla there.

On which OS does this issue occur?

[OS: Mac]

What is the version of your OS?

macOS 15.2

NuttX Version

master

Issue Architecture

[Arch: all]

Issue Area

[Area: Other]

Verification

  • I have verified before submitting the report.
@yamt yamt added the Type: Bug Something isn't working label Jan 16, 2025
@github-actions github-actions bot added Arch: all Issues that apply to all architectures OS: Mac Issues related to MacOS (building system, etc) labels Jan 16, 2025
@yamt
Copy link
Contributor Author

yamt commented Jan 16, 2025

another example of VLA:

union arg_u argvalue[MAX(numargs, 1)];

@yamt
Copy link
Contributor Author

yamt commented Jan 16, 2025

size_t poolsize[MEMPOOL_NPOOLS];

note: MEMPOOL_NPOOLS is defined using sizeof()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: all Issues that apply to all architectures OS: Mac Issues related to MacOS (building system, etc) Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant