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

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 4 15:35:19 PST 2017


efriedma added a comment.

> 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.)


https://reviews.llvm.org/D28820





More information about the cfe-commits mailing list