I thought a  push and pop pragma would work ( I use that in my code) ,
but that would be in the headers  which Robert wants to avoid


Gordon

__________________________________________________________
Gordon Tomlinson

Product Manager 3D
Email  : gtomlinson @ overwatch.textron.com
__________________________________________________________
(C): (+1) 571-265-2612
(W): (+1) 703-437-7651

"Self defence is not a function of learning tricks 
but is a function of how quickly and intensely one 
can arouse one's instinct for survival" 
- Master Tambo Tetsura

 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul
Martz
Sent: Monday, November 24, 2008 4:38 PM
To: 'OpenSceneGraph Users'
Subject: Re: [osg-users] pragma warnings disabled in headers

Hi all -- Sorry I'm coming into this a little late.

What I'd really like is a clean compile so that if I introduce some
suspicious code, I clearly see a new warning message displayed in the
output, so that I can investigate it. What I don't want is to have all
warnings disabled so that I never see a message about my bogus change.
If the warning is displayed, but I miss it because it's buried in
hundreds or thousands of other warnings unrelated to my code change,
then that's just as bad as having it disabled and not displayed at all.

> Perhaps the middle ground is to place the #pagma's in the CMake 
> generated include/osg/Config file?

This seems like the worst solution, because not only does it disable all
warnings in the OSG headers, it also disables it in my own application
code that directly or indirectly includes osg/Config. If I change code
and introduce a warning, I'll never see the warning message displayed
because osg/Config disabled it.

> The other approach is to do an explicit casts to avoid the warnings in

> the first place.  This is more wordy and while of dubious practical 
> value would at least fix the warnings.

Yes, this is probably the best solution, but is a prohibitive task to
bite off for a large existing code base.

A third solution, as Wojtek mentioned, is to wrap each OSG header file
with #pragma push/pop so that warnings can be disabled just in the
header, and not in user code that includes the header. This could be
done by changing all OSG headers to include CMake-generated prefix and
suffix files that contain the push/pops and disables. This is still an
undesirable solution because it turns all warnings off in OSG headers,
even for future code changes, but is no worse than what we had before
and is relatively easy to implement.
   -Paul

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to