[Insight-developers] Longstanding warnings in ThirdParty/MetaIO/src/MetaIO

Sean McBride sean at rogue-research.com
Thu Aug 25 16:08:32 EDT 2011


On Thu, 25 Aug 2011 19:34:57 +0000, Williams, Norman K said:

>No one has changed this code in some time.

Sorry about that, I guess I should have checked. :(

>The compiler's complaint appears to be bogus.  The code is clumsy-looking
>but it appears to be correct.
>
>_mf->value is (as the warning states of type double[4096],

Quite right, the char* cast threw me for a loop.  I'll take this up on the clang list.

>I don't build with CLang but someone who does should try this and see if
>it makes CLang stop complaining for no good reason.
>
>        *(static_cast<char *>(_mf->value) + sizeof(_mf->value) - 1) = '\0';

No, that's worse, it's an error.  But reinterpret_cast works, which I'm sure is what you meant. :)

>One might complain about the idea of using an array of double as a string
>buffer, but the fact is that no one is funded to re-write MetaIO right
>now.  There are dozens of ways in which MetaIO could be re-written to be
>closer to modern ideals for Software Engineering & C++. The existing code
>works, though.

:)

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the Insight-developers mailing list