Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6476587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:50:35+00:00 2026-05-25T06:50:35+00:00

In mcpp.exe –help Options available with only -@std (default) option: -@compat Expand recursive macro

  • 0

In mcpp.exe --help

Options available with only -@std (default) option:
-@compat    Expand recursive macro more than Standard.
-3          Enable trigraphs.
-K          **Output macro annotations embedding in comments.**

So, what does ‘macro annotation in comments’ mean?

http://mcpp.sourceforge.net/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:50:35+00:00Added an answer on May 25, 2026 at 6:50 am

    From the mcpp-summary-272.pdf file available at SourceForge (link in question):

    Also
    mcpp has a mode to output macro informations
    embedded in comments. This mode allows you
    to know macro calls and their locations on source
    file from preprocessed output.

    So, it leaves behind comments identifying the macros expanded, so that you can tell which source came from which macro.

    Illustration

    Source (x.c)

    #include <assert.h>
    int main(int argc, char **argv)
    {
        assert(argc != 0 && argv != 0);
        return 0;
    }
    

    mcpp x.c

    #line 1 "/Users/jleffler/src/cmd/x.c"
    #line 1 "/usr/include/assert.h"
    #line 42 "/usr/include/assert.h"
    #line 1 "/usr/include/sys/cdefs.h"
    #line 417 "/usr/include/sys/cdefs.h"
    #line 1 "/usr/include/sys/_symbol_aliasing.h"
    #line 418 "/usr/include/sys/cdefs.h"
    #line 494 "/usr/include/sys/cdefs.h"
    #line 1 "/usr/include/sys/_posix_availability.h"
    #line 495 "/usr/include/sys/cdefs.h"
    #line 43 "/usr/include/assert.h"
    #line 61 "/usr/include/assert.h"
    
    
    void abort(void)  ;
    
    int printf(const char *  , ...);
    
    #line 2 "/Users/jleffler/src/cmd/x.c"
    int main(int argc, char **argv)
    {
        ((void) ((argc != 0 && argv != 0) ? 0 : ((void)printf ("%s:%u: failed assertion `%s'\n", "/Users/jleffler/src/cmd/x.c" , 4 , "argc != 0 && argv != 0"), abort()) )) ;
        return 0;
    }
    

    mccp -K x.c (excerpt)

    I omitted about 560 lines of not very informative output, but the main code is:

    #line 2 "/Users/jleffler/src/cmd/x.c"
    int main(int argc, char **argv)
    {
        /*<assert 4:5-4:35*//*!assert:0-0 4:12-4:34*/((void) ((/*<assert:0-0*/argc != 0 && argv != 0/*>*/) ? 0 : /*<__assert*//*!__assert:0-0*//*!__assert:0-1*//*!__assert:0-2*/((void)printf ("%s:%u: failed assertion `%s'\n", /*<__assert:0-1*//*<__FILE__*/"/Users/jleffler/src/cmd/x.c"/*>*//*>*/, /*<__assert:0-2*//*<__LINE__*/4/*>*//*>*/, /*<__assert:0-0*//*<assert:0-0*/"argc != 0 && argv != 0"/*>*//*>*/), abort())/*>*/))/*>*/;
        return 0;
    }
    

    Or, with comments isolated one per line (manually):

    #line 2 "/Users/jleffler/src/cmd/x.c"
    int main(int argc, char **argv)
    {
        /*<assert 4:5-4:35*/
        /*!assert:0-0 4:12-4:34*/
        ((void) ((
          /*<assert:0-0*/
          argc != 0 && argv != 0
        /*>*/
                 ) ? 0 :
        /*<__assert*/
        /*!__assert:0-0*/
        /*!__assert:0-1*/
        /*!__assert:0-2*/
        ((void)printf ("%s:%u: failed assertion `%s'\n",
        /*<__assert:0-1*/
        /*<__FILE__*/
        "/Users/jleffler/src/cmd/x.c"
        /*>*/
        /*>*/
        ,
        /*<__assert:0-2*/
        /*<__LINE__*/
        4
        /*>*/
        /*>*/
        ,
        /*<__assert:0-0*/
        /*<assert:0-0*/
        "argc != 0 && argv != 0"
        /*>*/
        /*>*/
        ), abort())
        /*>*/
        ))
        /*>*/
        ;
        return 0;
    }
    

    What is the bug in this implementation of the assert() macro?

    Hint: the C99 standard says:

    §7.2.1.1 The assert macro

    The assert macro puts diagnostic tests into programs; it expands to a void expression.
    When it is executed, if expression (which shall have a scalar type) is false (that is,
    compares equal to 0), the assert macro writes information about the particular call that
    failed (including the text of the argument, the name of the source file, the source line
    number, and the name of the enclosing function — the latter are respectively the values of
    the preprocessing macros __FILE__ and __LINE__ and of the identifier
    __func__) on the standard error stream in an implementation-defined format. It
    then calls the abort function.

    The machine is running MacOS X Lion (10.7.1).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following macro definitions and invocation: #define x x[0] #define y(arg) arg y(x)
I am using g++ 4.3.0 to compile this example : #include <vector> int main()
Some time ago I was confused by the following behavior of some code when
I'm having issues with finalizers seemingly being called early in a C++/CLI (and C#)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.