Re: [PATCH] parse: support c99 [static ...] in abstract array declarators

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

 



On Wed, Apr 16, 2014 at 08:50:23PM -0700, Cody P Schafer wrote:
> On 04/16/2014 05:12 PM, Josh Triplett wrote:
> >On Tue, Apr 15, 2014 at 04:08:57PM -0700, Cody P Schafer wrote:
> >>Makes sparse a little more accepting than the standard: we accept any
> >>number of ["static", "restrict"] repeated in any order, while the n1570
> >>specifies (in 6.7.6.2.3) that either type-qualifiers (ie: "restrict")
> >>come first and are followed by "static" or the opposite ("static" then
> >>type-qualifiers).
> >>
> >>Also add a test.
> >>
> >>Signed-off-by: Cody P Schafer <cody@xxxxxxxxxxxxxxxxxx>
> >
> >What's the rationale for this?  Why should sparse accept more than the
> >standard allows?  What real-world code do you have that requires this?
> >
> >And would it be worth adding a warning for this non-standards-compliant
> >code, even if that warning isn't on by default?
> 
> I could have sparse be just as strict as the standard, it just was just
> (much) simpler to make it liberal in what it accepts. If you're fine with
> some more verbose code, I'll put together something that is stricter.

I'd suggest trying to match the standard in this case, or failing that
match what GCC does.

- 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