-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Allow inline assembly #293
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
Conversation
Could your code handle all variations of inline assembly syntax found in GNU-compatible compilers like Clang, including |
It can handle I didn't find any document of |
Simply search |
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.
Squash commits for reviewing.
Change-Id: If67148de2637a02fc44597700745056b846d7f32
a0ed7dc
to
cfddc51
Compare
Previously, fmtscan would report spelling in inline assembly and block committing. It supports the 'asm', '__asm__', and '__asm' keywords. According to the GCC documentation, the 'asm' keyword is a GNU extension and the alternative '__asm__' can be used when writing code compiled with '-ansi' and various '-std' options, and '__asm' is a historical keyword that the current documentation doesn't mention. Closes: sysprog21#292 Change-Id: I9564c47a6ae67278a9b0c42ee0087d597c9c33ab
Cppcheck cannot recognize the GNU extension of explicit register variables: register int x asm("eax"); This commit suppresses syntax error to prevent explicit register variables being blocked. It also makes real syntax error suppressed, but it doesn't affect much while real ones lead to compile-time errors and can be found early. Change-Id: I603fa80083ba935c7de706546f77bac616da6fcc
cfddc51
to
6385c40
Compare
Thank @lumynou5 for contributing! |
This patch is an attempt to enable inline assembly not being blocked by the checks.
Previously, fmtscan would report spelling in inline assembly and block committing, so an additional check is added to skip identifiers that are
asm
and contents in a pair of parentheses following them.Also, Cppcheck cannot recognize the GNU extension of explicit register variables:
This patch suppresses syntax error to prevent explicit register variables being blocked. It also makes real syntax error suppressed, but it doesn't affect much while real ones lead to compile-time errors and can be found early.