[ 
https://issues.apache.org/jira/browse/LUCY-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marvin Humphrey updated LUCY-71:
--------------------------------

    Attachment: quote.diff

A couple more minor issues with the latest QUOTE strategem popped up.  First,
MSVC complained about not getting enough arguments when the macro was fed
either pure whitespace or just a comment, forcing such lines to go unquoted:

{code:none}
QUOTE(      int i;                                                   )
QUOTE(      int retval;                                              )
            /* Rebuild command line args. */ 
QUOTE(      for (i = 1; i < argc; i++) {                             )
QUOTE(          command_len += strlen(argv[i]) + 1;                  )
{code}

Second, GCC warned about embedding __VA_ARGS__, so I manually quoted that.

{code:none}
QUOTE(  #include "_charm.h"                                   )   
QUOTE(  #define ISO_TEST(fmt, ...) \\                         )   
"           printf(fmt, __VA_ARGS__)                        \n"
QUOTE(  int main() {                                          )  
{code}

Despite the limitations, though, in my opinion QUOTE is still better than 
global 
manual quoting -- so here's the complete quote.diff patch, which purges 
METAQUOTE from the Charmonizer source files.

> Remove Perl dependency of METAQUOTE
> -----------------------------------
>
>                 Key: LUCY-71
>                 URL: https://issues.apache.org/jira/browse/LUCY-71
>             Project: Lucy
>          Issue Type: Improvement
>          Components: Charmonizer
>            Reporter: Nathan Kurz
>            Priority: Minor
>         Attachments: charm_and_harm_to_c_and_h.diff, quote.diff
>
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Charmonizer currently uses a Perl script 'METAQUOTE' to preprocess its 
> '.charm' files into '.c' files and '.harm' files into '.h' files.   This 
> works, but requires a dependency on Perl that seems inappropriate for a C 
> language tool.
> The suggested alternatives were to use manual quoting or standard macros.  
> Manual quoting seemed error prone and cumbersome, so this patch proposes the 
> using the 'stringify' (#expr) function within standard C preprocessor macros.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to