What does double underscore ( __const) mean in C?

前端 未结 4 821
一向
一向 2020-11-22 02:52
extern int ether_hostton (__const char *__hostname, struct ether_addr *__addr)
 __THROW;

I found the above function definition in /usr/include/neti

4条回答
  •  野性不改
    2020-11-22 03:35

    The underscore in __const means that this keyword is a compiler extension and using it is not portable (The const keyword was added to C in a later revision, 89 I think). The __THROW is also some kind of extension, I assume that it gets defined to some __attribute__(something) if gcc is used, But I'm not sure on that and too lazy to check. The __addr can mean anything the programmer wanted it to mean, It's just a name.

提交回复
热议问题