patch: new attribute enable_if

Nick Lewycky nlewycky at google.com
Mon Oct 7 01:03:15 PDT 2013


On 25 September 2013 08:17, Sean Silva <silvas at purdue.edu> wrote:

>
>
>
> On Mon, Sep 23, 2013 at 10:59 PM, Richard Smith <richard at metafoo.co.uk>wrote:
>
>> Hi Nick,
>>
>> This looks really promising. Do you yet know whether this is enough to
>> implement *all* the functionality of -DFORTIFY_SOURCE?
>>
>> One big thing missing here is documentation. That should serve to both
>> motivate the feature (and explain why it's sufficiently valuable for us to
>> have and maintain this extension), and to describe how it's intended to be
>> used, plus what we actually guarantee in terms of its semantics.
>>
>
> It may also be useful to run this past the GCC folks to get feedback. If
> this extension is truly useful, I would expect that we would want GCC to
> implement it as well, so it would be good to have them on board with the
> idea.
>

I don't think this will be productive. If I propose this, it won't be with
a patch, and gcc already doesn't implement attribute overloadable which is
necessary for my only use case. If we go all the way back to figuring out
how to satisfy my use case, they'll point out that gcc has already solved
fortify (in a way clang can't use, but that's not their problem) and I
don't forsee this discussion leading to any illumination.

If it's truly a useful extension, then it will show up in libraries and
that might motivate an implementation. As for getting the semantics right,
the primary technique is to base its semantics on existing rules in the
language standard, and the secondary technique is to try it out, myself
writing testcases and a customer is prototyping it in their library.

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131007/b2f94cd2/attachment.html>


More information about the cfe-commits mailing list