[PATCH] Disallow clang from assigning a diagnostic to ID zero

Craig Topper craig.topper at gmail.com
Thu Jul 18 23:29:22 PDT 2013


Shouldn't DIAG_START_COMMON be 1?


On Wed, Jul 17, 2013 at 6:52 PM, David Majnemer <david.majnemer at gmail.com>wrote:

> Updated version of the patch, just made it a little cleaner.
>
>
> CC'ing Argyrios Kyrtzidis as he, from svn history, seems to know the area.
>
>
> On Tue, Jul 2, 2013 at 2:57 PM, Richard Smith <richard at metafoo.co.uk>wrote:
>
>> LGTM, but I'd like someone who knows this area better than I do to look
>> at it.
>>
>> --- lib/Basic/DiagnosticIDs.cpp (revision 184534)
>> +++ lib/Basic/DiagnosticIDs.cpp (working copy)
>> @@ -82,11 +84,9 @@
>>  #include "clang/Basic/DiagnosticSemaKinds.inc"
>>  #include "clang/Basic/DiagnosticAnalysisKinds.inc"
>>  #undef DIAG
>> -  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
>>  };
>>
>> Are you sure nothing is using this to find the end of the table?
>>
>> On Tue, Jul 2, 2013 at 2:45 PM, David Majnemer <david.majnemer at gmail.com>
>> wrote:
>> > Ping
>> >
>> >
>> > On Fri, Jun 21, 2013 at 3:42 AM, David Majnemer <
>> david.majnemer at gmail.com>
>> > wrote:
>> >>
>> >> The fallout of r184401 made it apparent that clang uses diagnostic ID
>> zero
>> >> as a sentinel value while *also* assigning it to an actual diagnostic,
>> >> err_attribute_not_type_attr.
>> >>
>> >> The attached patch should do two things:
>> >> * Ensure that we don't give away ID 0
>> >> * Make sure that we will assert if we attempt to use ID 0
>> >>
>> >> --
>> >> David Majnemer
>> >
>> >
>>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>


-- 
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130718/db734983/attachment.html>


More information about the cfe-commits mailing list