[osg-users] [build] x86_64, cmd line, built OK - but warning in Xcode

Robert Osfield robert.osfield at gmail.com
Fri Jan 6 00:44:10 PST 2017


Hi Hartwig,

If there a minor changes that don't affect the ABI and fix warnings
then go ahead and make changes and make a github pull request for
them.

One has to be really careful when making these changes as you are only
fixing benign warnings, but with every code modification there is
danger of making a mistake that isn't picked up by the compiler or
cursory code review so you end up with a bug entering the code base.
This might sound hypothetical but I have had experience with problem a
number of times, both with mistakes I've made and ones made by
contributors that neither of us spotted until a bug was detected at a
later date.

Basically you have to assume any time you modify the code there is
danger of introducing bugs.

Robert.

On 5 January 2017 at 18:09, Hartwig Wiesmann
<hartwig.wiesmann at skywind.eu> wrote:
> Hi Robert,
>
> I fully agree with you!
> But would you mind if I submit patches that at least remove some warnings of existing code by adding an appropriate cast (the code with and without the cast should be identical)? I am especially concerned about header files because then the warnings are also polluting my code (and there might be some bugs).
>
> Example (taken from osg::Drawable):
>
>
> Code:
>         virtual void apply(const ByteArray& array) {  if (!array.empty()) _af.apply(_type,array.size(),&(array.front())); }
>
>
>
>
> should be replaced by
>
>
> Code:
>         virtual void apply(const ByteArray& array) {  if (!array.empty()) _af.apply(_type,static_cast<unsigned int>(array.size()),&(array.front())); }
>
>
>
>
> Doing this kind of modification in osg::Drawable alone will remove about 30 to 40 warnings already!
>
> Thank you!
>
> Cheers,
> Hartwig
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69889#69889
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list