Slashes and dots in function names and prototypes?

后端 未结 4 711
迷失自我
迷失自我 2020-12-30 03:48

I\'m new to C and looking at Go\'s source tree I found this:

https://code.google.com/p/go/source/browse/src/pkg/runtime/race.c

void runtime∕race·Read         


        
4条回答
  •  粉色の甜心
    2020-12-30 04:15

    The "·" character is \xB7 according to my Javascript console. The "∕" character is \x2215.

    The dot falls within Annex D of the C99 standard lists which special characters which are valid as identifiers in C source. The slash doesn't seem to, so I suspect it's used as something else (perhaps namespacing) via a #define or preprocessor magic.

    That would explain why the dot is present in the actual function definition, but the slash is not.

    Edit: Check This Answer for some additional information. It's possible that the unicode slash is just allowed by GCC's implementation.

提交回复
热议问题