当前位置:网站首页>__ The difference between typeof and typeof
__ The difference between typeof and typeof
2022-07-27 16:07:00 【The heart is like glass】
An identifier with double underscores is reserved for the implementation. typeof is a compiler specific extension to the language, so naming it __typeof ensures no user code has an identifier with the same name.
typeof() and __typeof() are compiler-specific extensions to the C language, because standard C does not include such an operator. Standard C requires compilers to prefix language extensions with a double-underscore (which is also why you should never do so for your own functions, variables, etc.)
typeof() is exactly the same, but throws the underscores out the window with the understanding that every modern compiler supports it. (Actually, now that I think about it, Visual C++ might not. It does support decltype() though, which generally provides the same behaviour as typeof().)
All three mean the same thing, but none are standard C so a conforming compiler may choose to make any mean something different.
-ansi and the various -std options disable certain keywords. This causes trouble when you want to use GNU C extensions, or a general-purpose header file that should be usable by all programs, including ISO C programs. The keywords asm, typeof and inline are not available in programs compiled with -ansi or -std (although inline can be used in a program compiled with -std=c99 or -std=c11). The ISO C99 keyword restrict is only available when -std=gnu99 (which will eventually be the default) or -std=c99 (or the equivalent -std=iso9899:1999), or an option for a later standard version, is used.
The way to solve these problems is to put ‘__’ at the beginning and end of each problematical keyword. For example, use asm instead of asm, and inline instead of inline.
An identifier with double underscores is reserved for the implementation. typeof is a compiler specific extension to the language, so naming it __typeof ensures no user code has an identifier with the same name.
https://stackoverflow.com/questions/14877415/difference-between-typeof-typeof-and-typeof-objective-c
http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html#Alternate-Keywords
https://clang.llvm.org/docs/UsersManual.html#c-language-features
边栏推荐
- Openwrt adds support for SD card
- [sword finger offer] interview question 41: median in data flow - large and small heap implementation
- Clickhouse 20.x distributed table testing and chproxy deployment (II)
- First acquaintance with MySQL database
- 移动端h5常见问题
- 逗号操作符你有用过吗?
- Pycharm导入已有的本地安装包
- Scratch crawler framework
- 携手SiFive,格兰仕进军半导体领域!两款自研芯片曝光
- vant-ui toast和dialog使用
猜你喜欢

Six capabilities of test and development

C language: function stack frame

openwrt 增加RTC(MCP7940 I2C总线)驱动详解

drf使用:get请求获取数据(小例子)

文本截取图片(哪吒之魔童降世壁纸)

Mapreduce实例(三):数据去重

mysql设置密码时报错 Your password does not satisfy the current policy requirements(修改·mysql密码策略设置简单密码)
![[tensorboard] oserror: [errno 22] invalid argument processing](/img/bf/c995f487607e3b307a268779ec1e94.png)
[tensorboard] oserror: [errno 22] invalid argument processing

Addition, deletion, query and modification of MySQL table data

: 0xC0000005: 写入位置 0x01458000 时发生访问冲突----待解
随机推荐
CAS compares the knowledge exchanged, ABA problems, and the process of lock upgrading
leetcode25题:K 个一组翻转链表——链表困难题目详解
C语言程序设计(第三版)
携手SiFive,格兰仕进军半导体领域!两款自研芯片曝光
centos上mysql5.7主从热备设置
Flask connects to existing tables in MySQL database
Baidu picture copy picture address
43亿欧元现金收购欧司朗宣告失败!ams表示将继续收购
MySQL索引
Nacos
DRF学习笔记(四):DRF视图
C language: string function and memory function
[system programming] process, thread problem summary
Personal perception of project optimization
ARIMA模型选择与残差
微信小程序个人号开通流量主
profileapi. h header
: 0xC0000005: 写入位置 0x01458000 时发生访问冲突----待解
Mlx90640 infrared thermal imager temperature sensor module development notes (VII)
Breaking through soft and hard barriers, Xilinx releases Vitis unified software platform for developers