[PATCH] Improve diagnostics of number-reading preprocessor directives
Michael Ilseman
milseman at apple.com
Tue Apr 9 14:29:04 PDT 2013
Thanks for the review! New patch attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnu_line_directive_diag.patch
Type: application/octet-stream
Size: 3695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130409/6ddbb6a5/attachment.obj>
-------------- next part --------------
On Apr 8, 2013, at 6:07 PM, Jordan Rose <jordan_rose at apple.com> wrote:
> We try not to pass around literal strings that will appear in diagnostics; please use %select instead. (Your parameter can then be something like IsGNULineMarker.)
>
> I'd also personally prefer "GNU line marker directive" to "digit directive".
>
> The basic structure of the patch looks fine.
> Jordan
>
>
> On Apr 8, 2013, at 17:31 , Michael Ilseman <milseman at apple.com> wrote:
>
>> Attached is a patch to improve the diagnostics of number-reading preprocessor directives. For example, the digit directive was sharing number-reading code with the #line directive, however some of the errors and warnings generated were written for the #line directive.
>>
>> #line 11foo1 ==> "#line directive requires a simple digit sequence"
>> # 11foo1 ==> "#line directive requires a simple digit sequence"
>>
>> This patch parameterizes the error/warning so that the caller can specify their own directive to report:
>>
>> #line 11foo1 ==> "#line directive requires a simple digit sequence"
>> # 11foo1 ==> "digit directive requires a simple digit sequence"
>>
>> Test case in patch.
>>
>>
>> <digit_directive_line_diag.patch>_______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
More information about the cfe-commits
mailing list