By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,171 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,171 IT Pros & Developers. It's quick & easy.

gcc Preprocessor (-E) with comments

P: n/a
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.

Jun 8 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
For this we can use option "gcc -E -dCHARD -o fileWithDefines file.c"

Jun 8 '07 #2

P: n/a
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
Jun 8 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.