Re: [PATCH] sparse/parse.c: ignore hotpatch attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 30, 2015 at 08:45:33AM -0700, Linus Torvalds wrote:
> On Tue, Apr 28, 2015 at 3:48 AM, Heiko Carstens
> <heiko.carstens@xxxxxxxxxx> wrote:
> > gcc knows about a new "hotpatch" attribute which sparse can safely ignore,
> > since it modifies only which code will be generated just like the
> > "no_instrument_function" attribute.
> 
> I'm wondering if sparse should just ignore all attributes it doesn't
> recognize, so that we could just remove this ever-expanding list of
> things that don't actually matter for sparse..
> 
> The "unrecognized attribute" thing made more sense way back when -
> when I wanted to get he basic attributes handled. Now it's just
> noise...

Unfortunately, ever so often there's an attribute we *can't* just
ignore, and in those cases it's better for us to warn rather than
breaking.  For instance, we won't just be able to ignore "cleanup"; we
need to actually handle it, because it affects code flow.

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.
That way, a codebase that includes detection for available GCC features
will avoid feeding us attributes and other features that we don't
understand.

I suspect that 3.2 is probably the version sparse should claim to be,
for now.

We could then use something like the patch you posted, possibly with the
addition of an attribute blacklist for any attributes we know we need to
do something with but don't yet, so that we warn about *those*
attributes and no others.  For anything only supported by a newer
version of GCC, it's the code we're scanning's fault for feeding us
something we never claimed to understand.

We can then update the version of GCC we claim to be once we add support
for any features of that version of GCC that absolutely need Sparse
support.

- 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




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux