gcc Preprocessor (-E) with comments

Discussion in 'C Programming' started by Subra, Jun 8, 2007.

  1. Subra

    Subra Guest

    Hi,

    I need to generate the auto comments for the preprocessed file
    (*.i).
    These comments must tell which of the Macro is used to substitute a
    particular string in the source code.

    I am in strage problem

    I am getting the below kind of error.

    /vobs/tools_vob/ace/ACE_wrappers-5.5.1/ace/Malloc_T.cpp:1045

    error: `__xpg_basename' is not a member of `ACE'

    At the line 1045 , it makes a call to the function "basename", which
    is very well defined !

    But after the preprocessor stage, this call is replaced to
    "_xpg_basename".
    I tried grepping in all the possible places but could not get this
    hopeless macro.
    So please help me.
    Subra, Jun 8, 2007
    #1
    1. Advertising

  2. Subra

    Flash Gordon Guest

    Subra wrote, On 08/06/07 11:24:
    > Hi,
    >
    > I need to generate the auto comments for the preprocessed file
    > (*.i).
    > These comments must tell which of the Macro is used to substitute a
    > particular string in the source code.


    Neither C nor C++ provide mechanisms for doing this. I've no idea
    whether gcc does or not, but that would be a question for a GCC group
    not here.

    > I am in strage problem
    >
    > I am getting the below kind of error.
    >
    > /vobs/tools_vob/ace/ACE_wrappers-5.5.1/ace/Malloc_T.cpp:1045


    ..cpp means it is C++ not C. C++ is not the same as C and is not topical
    here.

    > error: `__xpg_basename' is not a member of `ACE'
    >
    > At the line 1045 , it makes a call to the function "basename", which
    > is very well defined !
    >
    > But after the preprocessor stage, this call is replaced to
    > "_xpg_basename".
    > I tried grepping in all the possible places but could not get this
    > hopeless macro.
    > So please help me.


    C++ does name mangling.

    <OT>
    I suggest you try looking at using g++ instead of gcc, read the
    documentation and/or ask on a GNU group for why.

    A group you might find helpful is gnu.gcc.help, but CHECK the group
    first. You did not check here before posting otherwise you would have
    known this was the wrong place.
    --
    Flash Gordon
    Flash Gordon, Jun 8, 2007
    #2
    1. Advertising

  3. Subra

    Subra Guest

    For this we can use option "gcc -E -dCHARD -o fileWithDefines file.c"
    Subra, Jun 8, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jacek Dziedzic
    Replies:
    3
    Views:
    339
    Alf P. Steinbach
    Jul 22, 2003
  2. bigbinc

    Preprocessor gcc and override

    bigbinc, Jan 2, 2004, in forum: C++
    Replies:
    2
    Views:
    423
    Jacques Labuschagne
    Jan 2, 2004
  3. Cronus
    Replies:
    1
    Views:
    647
    Paul Mensonides
    Jul 15, 2004
  4. GCC Preprocessor

    , May 9, 2006, in forum: C Programming
    Replies:
    8
    Views:
    1,664
    Keith Thompson
    May 9, 2006
  5. Subra
    Replies:
    7
    Views:
    422
    Subra
    Jul 4, 2007
Loading...

Share This Page