[PATCH] Improve diagnostics of number-reading preprocessor directives

Jordan Rose jordan_rose at apple.com
Mon Apr 8 18:07:30 PDT 2013


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