https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115496

--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
A possible input to the logic could be: be more paranoid about strings that
will be used by inline asm.

(In reply to Andi Kleen from comment #3)
> When writing inline assembler an alternative to \n is to use ; as separator
> 
> e.g.
> 
> asm("movl $1,%eax ; "
>     "movl %eax,%ebx")
> 
> there can be also comment mistake here like
> 
> 
> asm("movl $1,%eax # comment ;"
>     "movl %eax,%ebx"); 
>  
> This incorrectly drops the second instruction. The \n warning wouldn't
> handle that case, it would need knowledge about # comments.

Yeah.  However we've traditionally avoided looking within the body of the
inline assembler.

I wonder if the use of '#' and ';' in asm sufficiently standardized to be
checkable (or if this way lies madness)

Reply via email to