Synopsis: | Only with a very good reason, the asm keyword may be used to insert assembly language directly into the translator output. |
Language: | C |
Severity Level: | 2 |
Category: | Lexical Elements |
Description: |
Justification Because of the variety of the used syntaxes (by different compilers) the asm keyword is not portable. It is better to use assembly source files with a c-header. Example 1 asm("TOIEEE ARO,R0"); /* RIGHT */ Example 2 asm("...." : "..."); /* RIGHT */ Example 3 asm volatile("...." : "..."); /* RIGHT */ Example 4 __asm__ ("..." : "...."); /* WRONG */ Example 5 __asm__ __volatile__ ("...." : "...."); /* WRONG */ |