[PATCH] Improve diagnostics of number-reading preprocessor directives

Jordan Rose jordan_rose at apple.com
Tue Apr 9 17:28:06 PDT 2013


LGTM, go ahead and commit.

Jordan


On Apr 9, 2013, at 14:29 , Michael Ilseman <milseman at apple.com> wrote:

> Thanks for the review! New patch attached.
> 
> <gnu_line_directive_diag.patch>
> 
> 
> 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