What does this do?

F

fdm

I have seen this as the first lines in some library code that I am reading:

#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif


Anyone that can tell me what it does?
 
I

Ian Collins

fdm said:
I have seen this as the first lines in some library code that I am reading:

#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif


Anyone that can tell me what it does?

A wild guess: disable warning 4786?
 
D

Default User

fdm said:
I have seen this as the first lines in some library code that I am
reading:

#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif


Anyone that can tell me what it does?

Did you do a web search for warning 4786?




Brian
 
J

James Kanze

I have seen this as the first lines in some library code that
I am reading:
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
Anyone that can tell me what it does?

Whatever the implementation documentation says it does. (I.e.
nothing, on most implementations.) _MSC_VER is in the
implementation namespace ; if the implementation defines it,
then this should be documented. If it's not defined, then of
course, the bit of code does nothing. If it is defined, the bit
of code invokes a pragma, which is implementation defined.
Which means, again, it should be documented; if it isn't, then
the pragma is also a no-op. (And again, this is probably the
case on most machines.)

So I'd suggest you start by reading your compiler's
documentation. If there's nothing there mentionning a "pragma
warning", then it should be a safe bet that the code is a no-op.
 
E

Eric Pruneau

fdm said:
I have seen this as the first lines in some library code that I am reading:

#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif


Anyone that can tell me what it does?

One way to disable a warning with the microsoft compiler is:

#pragma warning (disable: xxxx)

where xxxx is the warning number you want to disable.


Eric Pruneau
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top