-
Notifications
You must be signed in to change notification settings - Fork 7.7k
scripts/build: improve whitespace / empty parameter handling in syscall scripts #87633
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
base: main
Are you sure you want to change the base?
Conversation
Hello @lonkaars, and thank you very much for your first pull request to the Zephyr project! |
@lonkaars thanks for this. This can help to see of we can make a test-case / update existing test case to ensure the problem is indeed fixed as well as ensureing there are no side-effects. |
I'm currently working in a private repository so I can't share the original code that this fix is for. I've created a twister test case in my (local) Zephyr fork clone with the following function signature, which fails in the same way: __syscall void
test(int foo); Should I add While making the test case I also found |
I was assuming so.
would be nice to have as part of this PR.
Making it part of this PR is fine. |
Looking over the commit history on |
parse_syscalls.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work
Syscall regex matches may include whitespace characters other than space (i.e. `\n` or `\t`), which causes `gen_syscalls.py` to fail. This mainly affects long system call signatures wrapped onto multiple lines (e.g. by code formatter). This change replaces all successive whitespace in the regex match groups with a single space. Signed-off-by: Loek Le Blansch <loek.le-blansch.pv@renesas.com>
Syscalls can be declared without taking any parameters, but `gen_syscalls.py` crashes if a function that does not take parameters is declared using empty parenthesis instead of a single `void` parameter. This change allows the empty parenthesis notation for syscalls without parameters. Signed-off-by: Loek Le Blansch <loek.le-blansch.pv@renesas.com>
This commit adds tests for whitespace in syscall declaration function signatures and signatures without parameters. Signed-off-by: Loek Le Blansch <loek.le-blansch.pv@renesas.com>
This reverts commit 1993ea0 because the `parse_syscalls.py` script has been modified to not output whitespace characters other than spaces in the generated JSON file. Signed-off-by: Loek Le Blansch <loek.le-blansch.pv@renesas.com>
|
Syscall regex matches may include whitespace characters other than space (i.e.
\n
or\t
), which causesgen_syscalls.py
to fail. This mainly affects long system call signatures wrapped onto multiple lines (e.g. by code formatter). This change replaces all successive whitespace in the regex match groups with a single space.