-
Notifications
You must be signed in to change notification settings - Fork 2k
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
unify usage of inline assembly keywords #5059
Conversation
In this case I'd rather |
Why, if gcc suggests usage of |
Because it's ugly. Other than that I have no particular reason to prefer a #define over a %s/…/…/g. |
I don't find it ugly, but I also don't care. What would be the prefered location of such a define? |
I find it confusing to define a macro with the same name as a GCC extension. |
Actually, I have no idea. Please ignore my remarks. :) |
This is how CMSIS solves the described issue for different compilers: https://github.com/RIOT-OS/RIOT/blob/master/cpu/cortexm_common/include/core_cm0.h#L79 |
I would tend to go with
but if it solves the issue for |
👍 for unifying, I don't have a strong opinion on what the outcome is as long as it is unified across the tree. |
08e28ea
to
c3f7186
Compare
This PR should unify as is. Only file I didn't touch is |
Btw, from quickly looking at the diff I believe that there may be some missing volatile keywords at some of the inline asm. |
@@ -67,7 +67,7 @@ void msp430_init_dco(void) | |||
BCSCTL1 |= DIVA1 + DIVA0; /* ACLK = LFXT1CLK/8 */ | |||
|
|||
for (i = 0xFFFF; i > 0; i--) { /* Delay for XTAL to settle */ | |||
asm("nop"); | |||
__asm__("nop"); |
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.
@gebart you mean like here?
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.
Yes, like there
On Mar 31, 2016 10:33 PM, "Kaspar Schleiser" notifications@github.com
wrote:
In boards/telosb/board.c
#5059 (comment):@@ -67,7 +67,7 @@ void msp430_init_dco(void)
BCSCTL1 |= DIVA1 + DIVA0; /* ACLK = LFXT1CLK/8 */for (i = 0xFFFF; i > 0; i--) { /* Delay for XTAL to settle */
asm("nop");
**asm**("nop");
@gebart https://github.com/gebart you mean like here?
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/RIOT-OS/RIOT/pull/5059/files/c3f7186d4e686561b3e5714d91819d1b361542cd#r58122804
Will open an issue. edit #5218 |
(launching CI to check for build errors) |
ACK |
From "https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html":
"The asm keyword is a GNU extension. When writing code that can be compiled with -ansi and the various -std options, use
__asm__
instead ofasm
(see Alternate Keywords). "Stumbled upon this when trying to compile with -std=c11, which doesn't allow asm().