开发者

How to set Eclipse gcc compiler to ignore specific errors or change from error to warning

开发者 https://www.devze.com 2023-02-19 20:09 出处:网络
I need to build a project consisting of many C source and header files. The project compiles in xcode with warnings (which is fine) but when I try to compile it using the GNU gcc C compiler in Eclipse

I need to build a project consisting of many C source and header files. The project compiles in xcode with warnings (which is fine) but when I try to compile it using the GNU gcc C compiler in Eclipse on Windows XP, I get many "redeclaration of" and "nested redefinition of" errors. These errors all reference typedefs of enumerators in several different header files.

Each of these header files have appropriate #ifndef/#define/#endif tags around the entire file, but they typedef the same enumerators (think copy/paste typedefs into multiple headers) such that one header file will #include several other header files each of which have the same enumerator typedef with the same name.

I'm told this compiles with warnings in xcode and I am not allowed to modify the existing code.

As it compiles with warnings in xcode, I was trying to find a wa开发者_JAVA百科y to have Eclipse ignore those errors or change them to warnings to compile but have been unsuccessful. It doesn't matter if the compiler uses the first or the last definition/declaration. They are identical redefinitions/redeclarations.

Is there a way to do this?

Edit: compiling with error flag -Wall


Your compiler is unlikely to let you change an error into a warning. Most will let you go the other way around, though. Are you passing -Werror to the compiler in your windows/eclipse system? It sounds like some of your include guards aren't working. If you give us some more detail we might be able to help you out.

0

精彩评论

暂无评论...
验证码 换一张
取 消