Boost logo

Boost :

From: Frederick Akalin (akalin_at_[hidden])
Date: 2006-08-19 17:46:27

Cory Nelson wrote:
> You should encase your header in warning pragmas:
> #if defined(_MSC_VER) && _MSC_VER >= 1400
> #pragma warning(push)
> #pragma warning(disable:4996)
> #endif
> /* your stuff */
> #if defined(_MSC_VER) && _MSC_VER >= 1400
> #pragma warning(pop)
> #endif
I tried this--encasing the offending line in the header--and it didn't
work. I was puzzled because I had searched online
and found multiple sources that recommended that. However, I found this

Apparently, the warning is triggered in the line in the header file
(xutility, in my case), and not in
the line in my code. That means that the warning will be disabled only
if I put the pragmas above
before including any stdlib headers. Unfortunately, that is up to the
client code, and it makes writing
a header for this difficult. This will be changed in SP1, but it seems
like there's little library writers can do now.

This page:

also recommends the client turn off that warning globally or wrap all
that headers in that pragma. Looks like
I have to live with this until SP1.

Frederick Akalin

Boost list run by bdawes at, gregod at, cpdaniel at, john at