g++ __FUNCTION__ replace time

后端 未结 7 715
迷失自我
迷失自我 2020-12-20 17:16

Can anyone tell when g++ replaces the __FUNCTION__ \'macro\' with the string containing the function name? It seems it can replace it not until it has check the

7条回答
  •  一个人的身影
    2020-12-20 17:34

    You are using __FUNCTION__ like a preprocessor macro, but it's a variable (please read http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html).

    Try printf("%s", __FUNCTION__) just for testing and it will print the function name.

提交回复
热议问题