Hi Robert,

On 1/8/2014 3:11 PM, Robert Osfield wrote:
Hi Judson,

The push/pop approach has to be protected by platform specifics and has to be splurged all over the code, and it can't be tested by everyone so it will invariable lead to build breakages as things don't get added/or removed. I firmly believe it's a *TERRIBLE* solution so will not be allowing it anywhere near the OSG code base. If you want to make code portable, readable and maintainable for have to avoid such platform specific hacks.


Perhaps the warnings could be disabled when envoking the compiler instead? using CFLAGS or direct command line arguments. e.g. "cl /wd4244 /wd4251 /wd4275 /wd4512 /wd4276 /wd4702 /wd4511 some other stuff here"

Pros:
1) Removes platform specific code from the source files entirely.
2) Can be done per source file (technically...)
3) Allows the person compiling the code to determine which warnings they want to see.

Now fixing warnings themselves is the ideal, but, and it's a big but, the code changes to quieten warnings have to actively improve the code rather than just work around a warning for the sake of it. Fixing warnings willy nilly can introduce bugs, I know I've seen several come and go over the years, both mistakes I've made myself and ones I've spotted in contributions.

I think I am in agreement for the most part. However, I prefer leaving the warnings in vs. disabling them in the headers without restoring the original warning level state.

Warnings like C4244 can catch a lot of programmer errors, and forces the programmer to be explicit about their intentions. I have not compiled OSG with OSG_DISABLE_MSVC_WARNINGS undefined, so I have no idea how many warnings are being silenced to begin with.


Robert.


I will probably end up disabling OSG_DISABLE_MSVC_WARNINGS like you mentioned, and/or wrap all of the OSG includes in my code with #pragma warning push/pop. I have not figured out which avenue to pursue yet.

Thanks again,

Judson

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to