Menu

#44 improve parsing macro syntax error detection and reporting

1.2.0
accepted
None
Implementation
critical
0.4.0
enhancement
2012-09-10
2012-05-08
No

There are fundamental limitations on the amount of syntax error checking and reporting that can be done using the preprocessor. However, the current macro implementation do very little syntax error reporting, they just let errors fail at compile-time. This is to simplify the macros but in some cases a syntax error detected and reported by the paring macro might be more readable -- is there any such a case?

Discussion

  • Lorenzo Caminiti

    • priority changed from major to critical
    • milestone changed from Release to Future
     
  • Lorenzo Caminiti

    Generate and ERROR_... if more bases than CONFIG_INHERITANCE_MAX are specified.

     
  • Lorenzo Caminiti

    Generate and ERROR_... if more than CONFIG_FUNCTION_ARITY_MAX function parameters are specified.

     
  • Lorenzo Caminiti

    Can I generate and ERROR_... if I forget to use access level public/protected/private for constructors, destrutors, and member functions? I'm not sure if this can be done but it'd be very helpful...

     
  • Lorenzo Caminiti

    When I miss a parenthesis around a token, GCC often gives the error:

    macro "BOOS_PP_TUPLE_ELEM_2_0" requires 2 arguments, but only 1 given

    If that is really the error for most missing parenthesis and also on MSVC, change BOOST_PP_TUPLE_ELEM_2_0(x, y) to ERROR_missing_parenthesis_around_one_or_more_tokens(x, y).

     
  • Lorenzo Caminiti

    Replying to lcaminiti:

    Generate and ERROR_... if more bases than CONFIG_INHERITANCE_MAX are specified.

    Done. Now generating error if more bases than CONFIG_INHERITANCE_MAX.

     
  • Lorenzo Caminiti

    Replying to lcaminiti:

    Generate and ERROR_... if more than CONFIG_FUNCTION_ARITY_MAX function parameters are specified.

    Done. Now generating ERROR_ if more parameters than CONFIG_FUCNTION_ARITY_MAX.

     
  • Lorenzo Caminiti

    • status changed from new to accepted
     
  • Lorenzo Caminiti

    • milestone changed from Future to 1.2.0
     

Log in to post a comment.