编译器支持GNU声明前pression的 [英] Compiler support of GNU Statement Expression
本文介绍了编译器支持GNU声明前pression的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这现代编译器支持GNU的声明前pression(C和C ++语言)。我应该有哪些版本使用的语句前pressions?
Which modern compilers support the Gnu Statement expression (C and C++ languages). What versions should I have to use a statement expressions?
声明前pression就像水木清华({code code;} RETVAL)
:
Statement expression is smth like ({ code; code; retval })
:
int b=56;
int c= ({int a; a=sin(b); a})
我已经知道了一些这样的编译器:
I already know some such compilers:
- GCC> = 3
- 锵/ LLVM> =
- 英特尔C ++编译器> = 6.0(Linux版本的,检查4页;位有限)
- 的Sun Studio> = 12(<一个href=\"http://developers.sun.com/solaris/articles/c_type.html#Using%20Statement%20Ex$p$pssions%7Coutline\"相对=nofollow>新语言扩展)
- IBM XL用于z / OS(<一个href=\"http://publib.boulder.ibm.com/infocenter/zos/v1r11/topic/com.ibm.zos.r11.cbclx01/statement_ex$p$pssions.htm\"相对=nofollow>标记为IBM扩展)
- Open64(因为它使用的操作系统preY-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):
- 微软的Visual C ++
PS。一些C / C ++编译器中列出 rel=\"nofollow\">但我感兴趣的只是成熟的编译器,被广泛采用(例如,不是一个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
这篇关于编译器支持GNU声明前pression的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文