ChinaUnix.net
相关文章推荐:

ISO C90 forbids mixed declarations and code

我定义了一个 # define ASSERT_ARGS(a) ((void)0) 然后在函数里面使用这个宏,比如: int foo(arg) { ASSERT_ARGS(arg); int i = 0; bar(i); return 1; } 但是编译会出现 iso c90 forbids mixed declarations and code 这个宏如何定义才能绕过这个错误? 不允许交换宏在代码中的位置,仅仅是改写这个宏,宏定义的代码必须能gcc 优化掉,比如((void)0). 这个好像有点难度,我一直没有找到方法。 ...

by zhuomingliang - C/C++ - 2010-11-17 11:03:36 阅读(16684) 回复(17)

相关讨论
by dengcainiao - 内核/嵌入技术 - 2006-12-12 14:58:38 阅读(492) 回复(0)
by dengcainiao - 内核源码 - 2007-09-20 17:01:36 阅读(20749) 回复(2)

报错:[code]E:\project\test-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK____\..\..\QtProject\test\main.cpp:2: In file included from ..\..\QtProject\test\main.cpp:2: E:\project\test-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK____\..\..\QtProject\test\Test.h:24: 错误:iso C++ forbids declaration of 'setA' with no type E:\project\test-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK____...

by 轻逐微风 - C/C++ - 2012-10-28 22:37:48 阅读(2172) 回复(2)

qt  how to get rid of the compile problem:  error: iso C++ forbids casting to an array type `char qt_invoke(int, QUObject*)' Description: I have a slot which is declared in designer's Object Explorer ,as: infoDialogShow( char [] ename, char [] cname) when compilling the whole project,i got the following errors: .moc/moc_formmain.cpp: In method `bool formmain::qt_invoke(int, QUObje...

by kjpioo - Linux文档专区 - 2009-01-05 21:23:58 阅读(806) 回复(0)

#include using namespace std; class Deta {public: Deta(int,int,int); Deta(int,int); Deta(int); Deta(); void display(); private: int x; int y; int z; } Deta :: Deta(int a,int b,int c): x(a),y(b),z(c) {} Deta :: Deta(int a,int b): x(a),y(b) { z=2006; } Deta :: Deta(int a): x(a) { y=1; z=2006; } Deta:: Deta() { x=10; y=1; z=2006; } void Deta::display() {cout<

by iyxing - C/C++ - 2008-03-25 19:03:47 阅读(1534) 回复(1)

错误指向了这一行。 extern master_info_tp* pmaster_info; 我只是声明一个外部结构体指针,这么做不行?

by wang9736 - C/C++ - 2008-11-12 15:51:14 阅读(4823) 回复(6)

HP StorageWorks Autoloader 1/8在做完备份之后,更换磁带的时候,带子没有出仓,面板上的红灯亮起,显示屏上显示"ERROR! code: 90",重启了一下机器也没有起作用。 打hp售后电话,说是机械故障,需要上门维修,有点不甘心,最后在一个论坛上看到有人这么操作 回到[HOME]面板,然后用[+]或[-]调整到[CONFIGURATION],按[ENTER]键进入,选择[RESET];重置之后重新读盘,可问题依旧;最后没有办法,强行把仓门面板给移开,...

by cocke - Linux文档专区 - 2008-11-04 13:36:24 阅读(1163) 回复(0)

A type specifier of the form struct-or-union identifier { struct-declaration-list } declares the identifier to be the tag of the structure or union specified by the list. A subsequent declaration in the same or an inner scope may refer to the same type by using the tag in a specifier without the list: struct-or-union identifier 上面蓝色字体部分不太明白它的意思是怎样的struct, 可以用...

by shihyu - C/C++ - 2007-06-13 00:05:32 阅读(1064) 回复(0)

A very special rule applies to declarations of the form struct-or-union identifier; that declare a structure or union, but have no declaration list and no declarators. Even if the identifier is a structure or union tag already declared in an outer scope (Par.A.11.1), this declaration makes the identifier the tag of a new, incompletely-typed structure or union in the current scope. This ...

by shihyu - C/C++ - 2007-06-11 21:04:32 阅读(1309) 回复(2)