当前位置:网站首页>__ 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
边栏推荐
- C language: dynamic memory function
- 判断数据的精确类型
- Mapreduce实例(一):WordCount
- Clickhouse 20.x distributed table testing and chproxy deployment (II)
- keil 采用 makefile 实现编译
- Mapreduce实例(二):求平均值
- 解决openwrt package目录下多个文件夹重名编译警告(call subdir 函数)
- [sword finger offer] interview question 41: median in data flow - large and small heap implementation
- Leetcode-1: sum of two numbers
- Reduce program ROM ram, GCC -ffunction sections -fdata sections -wl, – detailed explanation of GC sections parameters
猜你喜欢
![[sword finger offer] interview question 54: the k-largest node of the binary search tree](/img/13/7574af86926a228811503904464f3f.png)
[sword finger offer] interview question 54: the k-largest node of the binary search tree

多线程带来的的风险——线程安全

Determine the exact type of data

无线网络分析有关的安全软件(aircrack-ng)

Openwrt adds RTC (mcp7940 I2C bus) drive details

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

DeFi安全之DEX与AMMs

Mapreduce实例(三):数据去重

Flask连接mysql数据库已有表

Solve mt7620 continuous cycle uboot (LZMA error 1 - must reset board to recover)
随机推荐
43亿欧元现金收购欧司朗宣告失败!ams表示将继续收购
Vant UI toast and dialog use
Pycharm导入已有的Project
剑指 Offer 51. 数组中的逆序对
QT (VI) value and string conversion
TSMC's counterattack: it accused lattice core of infringing 25 patents and asked for prohibition!
Flask connects to existing tables in MySQL database
接连取消安富利/文晔/世平代理权,TI到底打的什么算盘?
Keil implements compilation with makefile
少见的按位操作符
企业运维安全就用行云管家堡垒机!
移动端h5常见问题
Using Lombok results in the absence of parent class attributes in the printed toString
[sword finger offer] interview question 45: arrange the array into the smallest number
Solve the compilation warning of multiple folders with duplicate names under the openwrt package directory (call subdir function)
Six capabilities of test and development
[sword finger offer] interview question 51: reverse pairs in the array - merge sort
C: On function
[sword finger offer] interview question 46: translating numbers into strings - dynamic programming
[sword finger offer] interview question 50: the first character that appears only once - hash table lookup