GNU 语句表达式的编译器支持 [英] Compiler support of GNU Statement Expression
本文介绍了GNU 语句表达式的编译器支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
哪些现代编译器支持 Gnu 语句表达式(C 和 C++ 语言).我应该使用哪些版本的语句表达式?
Which modern compilers support the Gnu Statement expression (C and C++ languages). What versions should I have to use a statement expressions?
语句表达式类似于 ({ code; code; retval })
:
int b=56;
int c= ({int a; a=sin(b); a})
我已经知道一些这样的编译器:
I already know some such compilers:
- GCC >=3
- Clang/LLVM >= ?
- 英特尔 C++ 编译器 >= 6.0(Linux 版本,检查第 4 页;位有限)
- Sun Studio >= 12(新语言扩展)
- IBM XL for z/OS (标记为 IBM 扩展)
- Open64(因为它使用 osprey-gcc 前端)
- GCC >=3
- Clang/LLVM >= ?
- Intel C++ Compiler >= 6.0 (Linux version, check page 4; bit limited)
- Sun Studio >= 12 (New Language Extensions)
- IBM XL for z/OS (marked as IBM extension)
- Open64 (as it uses osprey-gcc frontend)
这个编译器似乎不支持这个(我不确定):
This compiler seems not to support this (i'm unsure):
- MS Visual C++
附注.此处列出了一些 C/C++ 编译器,但我只对广泛使用的成熟编译器感兴趣(例如,不是 tcc 或涡轮 c)
PS. some C/C++ compilers are listed here but I interested only in mature compilers, that are used widely (e.g not a tcc or turbo c)
推荐答案
它支持 gnu99 与 "−std=gnu99"
It support gnu99 with "−std=gnu99"
这篇关于GNU 语句表达式的编译器支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文