CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
IBM Rational 系统开发最佳实践工具包 WebSphere MQ 最佳实践 TOP 15
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C/C++ >  C++ 语言

如何得到函数mangling后的名字?

楼主edwardlj()2006-03-16 14:41:51 在 C/C++ / C++ 语言 提问

在编译过过程中,编译器会将重载和继承函数转换为不同的c函数名,请问如何得到转换后的名字?vc中有__FUNCDNAME__可以实现该功能,请问在g++下有什么办法吗?最好是使用c++标准的东西,尽量不使用编译器扩展的东西,多谢了! 问题点数:100、回复次数:4Top

1 楼jiangsheng(蒋晟.Net[MVP])回复于 2006-03-16 15:37:42 得分 50

__FUNCDNAME__是C99标准,g++应该支持的吧?g++似乎有自己的扩展   __PRETTY_FUNCTION__Top

2 楼houdy(致力于图像/图形领域,成为有思想的程序员)回复于 2006-03-16 18:53:22 得分 20

function   name   mangling   本身就是编译器行为,C++标准中应该没有明确指出name   mangling该怎么实现。所以我觉得,查看name   mangling后的接过还是需要编译器支持的。  
  Top

3 楼fangrk(加把油,伙计!)回复于 2006-03-16 19:34:21 得分 20

好像是编译器的实现细节,干嘛要知道这个?各个编译器的方法可能都有出入,虽然最终可能会统一。Top

4 楼ugg(逸学堂(exuetang.net))回复于 2006-03-16 20:01:52 得分 10

ANSI-Compliant   Predefined   Macros  
  Macro   Description    
  __DATE__   The   compilation   date   of   the   current   source   file.   The   date   is   a   string   literal   of   the   form   Mmm   dd   yyyy.   The   month   name   Mmm   is   the   same   as   for   dates   generated   by   the   library   function   asctime   declared   in   TIME.H.      
  __FILE__   The   name   of   the   current   source   file.   __FILE__   expands   to   a   string   surrounded   by   double   quotation   marks.    
  You   can   create   your   own   wide   string   version   of   __FILE__   as   follows:  
  __LINE__   The   line   number   in   the   current   source   file.   The   line   number   is   a   decimal   integer   constant.   It   can   be   altered   with   a   #line   directive.      
  __TIME__   The   most   recent   compilation   time   of   the   current   source   file.   The   time   is   a   string   literal   of   the   form   hh:mm:ss.      
   
  Microsoft-Specific   Predefined   Macros  
  __FUNCDNAME__   Valid   only   within   a   function   and   returns   the   decorated   name   of   the   enclosing   function   (as   a   string).   __FUNCDNAME__   is   not   expanded   if   you   use   the   /EP   or   /P   compiler   option.    
   
  Top

相关问题

  • 如何在c++中得到当前函数的名字。
  • 如何得到函数名?
  • 我用VC工具DUMPBIN.EXE 得到的.def文件为什么没有输出函数名名字呢?
  • ???????????如何通过函数名(字符串)调用函数????????????
  • 函数定义中的名字解析
  • scanf函数可以得到回车吗?
  • 一个得到访客IP的函数
  • textBox得到焦点的函数是啥?
  • 已知网上一台计算机的 IP 地址,在VC中用什么函数可以得到这台机器的名字(100)
  • vc中,在一个函数内部如何得到函数名和函数参数,将其打印出来?

关键词

  • c++
  • 编译器
  • 函数
  • source
  • funcdname
  • mangling
  • current source
  • 实现
  • 标准
  • compiler

得分解答快速导航

  • 帖主:edwardlj
  • jiangsheng
  • houdy
  • fangrk
  • ugg

相关链接

  • C/C++ Blog
  • C/C++类图书
  • C/C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo