[PATCH] D28820: Warn when calling a non interrupt function from an interrupt on ARM

KCG via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 4 21:23:04 PST 2017


kc.austin2017 added a comment.

In https://reviews.llvm.org/D28820#944365, @efriedma wrote:

> > What is the best way to modify the code for this compiler change ?
>
> Currently, the "interrupt" attribute only has an effect on functions, not function pointers, so your code won't work the way you want.  It's a bug that we don't emit a warning for this.
>
> Currently, this warning doesn't have its own warning flag, instead being lumped under -Wextra.  This is also a bug.
>
> We don't emit the warning if your code is compiled for a target which doesn't support floating-point (-mfpu=none or -msoft-float); see https://reviews.llvm.org/D32918. But otherwise, if you're sure your code is actually correct, you can turn off the warning with -Wno-extra or something like that.  (The whole thing is kind of awkward because the implementation of the interrupt attribute in clang is buggy: the frontend lies to the backend about the calling convention, so the backend can't save/restore VFP registers correctly.)


so is there any plan to make the "interrupt" attribute not just support on functions?


https://reviews.llvm.org/D28820





More information about the cfe-commits mailing list