On Thu, Apr 30, 2015 at 10:51:42AM -0700, Linus Torvalds wrote: > On Thu, Apr 30, 2015 at 10:38 AM, <josh@xxxxxxxxxxxxxxxx> wrote: > > I think part of the problem arises because sparse claims (via the > > preprocessor symbols we provide) to be whatever version of GCC it was > > compiled with. I think that's a mistake. We should pick a version of > > GCC for which we support all the attributes we actually need to do > > something with, and advertise ourselves specifically as that version. > > Fair enough. Although there may then be headers that are unhappy. If you mean the GCC internal headers, I don't think those have version checks; after all, you'd only use them with the GCC they ship with, right? ;) For any other headers, I think we'll get worse results by claiming to be a version of GCC that has features we don't actually support. > > I suspect that 3.2 is probably the version sparse should claim to be, > > for now. > > That may be too old. You can't reliably compile the kernel with gcc > that old (some config options will complain). > > At least CONFIG_GCOV_KERNEL wants 3.4 minimum. If we want to claim to be 3.4 instead, then there are some attributes we'll need to check for and warn if we find. From a quick read of https://ohse.de/uwe/articles/gcc-attributes.html I think this is a complete list of attributes in 3.4 that sparse has to care about but doesn't currently support: cleanup gcc_struct ms_struct "cleanup" we'll need to handle because it affects control flow; gcc_struct and ms_struct affect structure layout, which we have warnings related to. For the moment, we could just add an explicit warning if we see any of those three attributes, set our GCC version to 3.4, and then drop the "unknown attribute" warning. - Josh Triplett -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html