Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: melek on March 01, 2011, 12:19:49 AM



Title: Bitcoin compilation - 1253 warnings
Post by: melek on March 01, 2011, 12:19:49 AM
Compiling bitcoind in XCode results in a lot of warning messages:

http://img543.imageshack.us/img543/6062/screenshot20110228at416.png (http://img543.imageshack.us/i/screenshot20110228at416.png/)

http://img46.imageshack.us/img46/9896/screenshot20110228at410.png (http://img46.imageshack.us/i/screenshot20110228at410.png/)

Most of the warnings are repetitive, and seem to be related to the use of the macro IMPLEMENT_SERIALIZE. There are also warnings about variables that are defined but never used. Is anybody looking in cleaning up these warning messages?

Also, the bitcoin code seems to rely excessively on the use of macros, rather than using actual functions. I am not completely familiar with the details of why these macros are used, but isn't it considering bad coding style to actually rely on macros from the perspective of clarity and maintainability?


Title: Re: Bitcoin compilation - 1253 warnings
Post by: melek on March 01, 2011, 12:21:22 AM
Oops, I think this should be moved to the developer section. I posted here by mistake.


Title: Re: Bitcoin compilation - 1253 warnings
Post by: error on March 03, 2011, 05:50:48 PM
Macros are evil (http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.5). They should not normally be used in C++ code. That said, I haven't yet looked at this particular macro to see if it actually should be a macro, but smart bitcoins will bet that it should not be.


Title: Re: Bitcoin compilation - 1253 warnings
Post by: jgarzik on March 03, 2011, 06:07:02 PM
Most of the warnings are repetitive, and seem to be related to the use of the macro IMPLEMENT_SERIALIZE. There are also warnings about variables that are defined but never used. Is anybody looking in cleaning up these warning messages?

We don't get these warnings when building with gcc and other compilers.