[Insight-developers] trying to fix mac warnings
Sean McBride
sean at rogue-research.com
Wed Feb 23 13:37:21 EST 2011
On Wed, 23 Feb 2011 18:29:50 +0000, Johnson, Hans J said:
>I've seen this type of behavior when conditional code exists for only one
>platform, but not another. This file is an empty file on all platforms
>except WIN64.
Exactly, here's a summary:
<http://lists.apple.com/archives/Unix-porting/2008/Apr/msg00027.html>
>There are two ways I've worked around this:
>Clean but painful: only complile this conditionally when WIN64 is needed.
>Easy but ugly: make a new function that is always compiled called
>"void
>i_am_a_dummyfunction_to_silence_compiler_warning_vnl_c_vector_longlong_cxx(
>void) {};
The ugly way may merely trade one warning for another. The compiler, or
a static analysis tool, may warn that the function is never used. And
even if not, imho, it's worse to export a public symbol that does
nothing than to have this warning.
--
____________________________________________________________
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