asm volatile(...);
__asm__ __volatile__(...);
I see both are used; why create some duplicate stuff?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The C standard reserves ‘asm’ for use by users for any purpose. Therefore, GCC provides the
__asm__notation to avoid running into the user’s name space (because identifiers starting with double underscore are reserved for the implementation).The notation with the double underscore is ungainly, so GCC provides the pleasanter interface without the double underscores. But if you turn on a standard-compliant compilation mode (such as
-std=c99), theasmoption is turned off. By writing with the double underscore notation, it is always available.So,
asmis pleasanter to read, but__asm__is compliant with the C standard.