public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* __PRETTY_FUNCTION__ cont
@ 2004-04-13 15:13 Tim Canham
  2004-04-13 17:26 ` llewelly
  0 siblings, 1 reply; 3+ messages in thread
From: Tim Canham @ 2004-04-13 15:13 UTC (permalink / raw)
  To: gcc-help

I posted a message earlier about the __PRETTY_FUNCTION__ symbols in our 
gcc code. A number of people on the list sent messages, the gist of 
which seemed to be that they only appear if they are referenced in the 
code. I was able to reproduce that on a small scale, but something in 
our large build is producing those symbols without us referencing them. 
We don't have them in our code. Is there anything else that would cause 
them to be generated besides user code referring to them?
-- 
Timothy K. Canham
Jet Propulsion Laboratory
Pasadena, CA
Timothy.Canham@jpl.nasa.gov
MDS Flight Software

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: __PRETTY_FUNCTION__ cont
  2004-04-13 15:13 __PRETTY_FUNCTION__ cont Tim Canham
@ 2004-04-13 17:26 ` llewelly
  2004-04-13 21:20   ` Tim Canham
  0 siblings, 1 reply; 3+ messages in thread
From: llewelly @ 2004-04-13 17:26 UTC (permalink / raw)
  To: Tim Canham; +Cc: gcc-help

Tim Canham <Timothy.Canham@jpl.nasa.gov> writes:

> I posted a message earlier about the __PRETTY_FUNCTION__ symbols in
> our gcc code. A number of people on the list sent messages, the gist
> of which seemed to be that they only appear if they are referenced in
> the code. I was able to reproduce that on a small scale, but something
> in our large build is producing those symbols without us referencing
> them. We don't have them in our code.

If you can reproduce this with preprocessed source, please consider
    reporting a bug; see gcc.gnu.org/bugs.html .

> Is there anything else that
> would cause them to be generated besides user code referring to them?

Maybe a macro from a 3rd party lib uses __PRETTY_FUNCTION__ ?

Have you tried running the preprocessor on each file, and grepping the
    output for __PRETTY_FUNCTION__ ? If you have, and
    __PRETTY_FUNCTION__ doesn't occur in the preprocessor output, but
    does occur in the binary, I think you should report a bug.

Maybe you can use some shell hackery to remove these unwanted
    symbols, like this:

nm do | grep -v '__PRETTY_FUNCTION__' | sed -e 's/[0-9a-f]* *[a-zA-Z]/-K/' | xargs strip do

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: __PRETTY_FUNCTION__ cont
  2004-04-13 17:26 ` llewelly
@ 2004-04-13 21:20   ` Tim Canham
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Canham @ 2004-04-13 21:20 UTC (permalink / raw)
  To: llewelly; +Cc: gcc-help

Solved!

Thanks for the pointer llewelly... (I should have tried it)

whenever you put an assert in your code, the definition of assert w/out 
-DNDEBUG has a PRETTY_FUNCTION symbol in it.

So,

#include <cassert>

int main(int argc, char* argv[]) {
   assert(0);
}

generates a PRETTY_FUNCTION symbol, even though it isn't in your code.

llewelly@xmission.com wrote:
> Tim Canham <Timothy.Canham@jpl.nasa.gov> writes:
> 
> 
>>I posted a message earlier about the __PRETTY_FUNCTION__ symbols in
>>our gcc code. A number of people on the list sent messages, the gist
>>of which seemed to be that they only appear if they are referenced in
>>the code. I was able to reproduce that on a small scale, but something
>>in our large build is producing those symbols without us referencing
>>them. We don't have them in our code.
> 
> 
> If you can reproduce this with preprocessed source, please consider
>     reporting a bug; see gcc.gnu.org/bugs.html .
> 
> 
>>Is there anything else that
>>would cause them to be generated besides user code referring to them?
> 
> 
> Maybe a macro from a 3rd party lib uses __PRETTY_FUNCTION__ ?
> 
> Have you tried running the preprocessor on each file, and grepping the
>     output for __PRETTY_FUNCTION__ ? If you have, and
>     __PRETTY_FUNCTION__ doesn't occur in the preprocessor output, but
>     does occur in the binary, I think you should report a bug.
> 
> Maybe you can use some shell hackery to remove these unwanted
>     symbols, like this:
> 
> nm do | grep -v '__PRETTY_FUNCTION__' | sed -e 's/[0-9a-f]* *[a-zA-Z]/-K/' | xargs strip do
> 

-- 
Timothy K. Canham
Jet Propulsion Laboratory
Pasadena, CA
Timothy.Canham@jpl.nasa.gov
MDS Flight Software

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-13 21:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-13 15:13 __PRETTY_FUNCTION__ cont Tim Canham
2004-04-13 17:26 ` llewelly
2004-04-13 21:20   ` Tim Canham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).