vxworks解决注释不匹配问题

vxworks默认的注释类型是“/*。。。。。*/”在使用C++类型的注释“//”,就有可能报错。 一种方法是移除-ansi开关。可是怎么移除呢?对许多对编译器不太了解的人可能看了FAQ了不知道怎么办。下面具体讲解:

在vxworks的工程里有build这个选项,字体变黑的就是你选的编译类型以default为例,双击default(默认的),在c/c++compiler和assember里将-ansi去掉,然后再OK!
下面来自预编译器文档`-lang-c', `-lang-c89', `-lang-c++' 
`-lang-objc', `-lang-objc++' 
Specify the source language. `-lang-c' is the default; it allows recognition of C++ 
comments (comments that begin with `//' and end at end of line), since this is a common 
feature and it will most likely be in the next C standard. `-lang-c89' disables recognition
of C++ comments. `-lang-c++' handles C++ comment syntax and includes extra default include 
directories for C++. `-lang-objc' enables the Objective C `#import' directive. `-lang-objc++' 
enables both C++ and Objective C extensions. These options are generated by the compiler 
driver gcc, but not passed from the `gcc' command line unless you use the driver's `-Wp' 
option .

其实如果要跟深入了解,可以看看GNU方面的资料

另外,在.cpp格式的文件中可以使用//做注释,编译不会报错。
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值