While developing a C++ application, I had to use a 3rd party library which produced a huge amount of warnings related with a harmless #pragma directive being used.
../File.hpp:1: warning: ignoring #pragma ident
In file included from ../File2.hpp:47,
from ../File3.hpp:57,
from File4.h:49,
Is it possibl...
Is there a difference between the two examples below for beginning a Perl script? If so, when would I use one over the other?
example 1:
#!/usr/bin/perl
use warnings;
example 2:
#!/usr/bin/perl -w
...
can u tell me usage of #pragma in c with an example
...
Hi,
A website of mine will host the usual images, javascript and CSS stylesheets in the database. Since these are unlikely to change each day, I am going to use some client caching on these to reduce the server load.
How long do you cache these? A few days? More?
I'm probably not going to reuse the same name twice if I update the reso...
Is there a way to set a pragma disable warning for visual studio for an entire solution?
...
In C++, there was a #pragma to output to the build log. Does one exist for Visual Studio 2005 C# ? And, does anyone know where an actual list of all the #pragma names can be found?
...
I've started a new project and have decided to make sure it builds cleanly with the /Wall option enabled. The only problem is not all 3rd party libraries (like boost) compile without warnings, so I've resorted to doing this in a shared header:
#pragma warning(push)
#pragma warning(disable:4820)
#pragma warning(disable:4619)
#pragma war...
I'm using Fmod in a project I'm working on in Visual C++ 2008. If I include
../fmodapi375win/api/lib/fmodvc.lib
in Project->Linker->Input, it works fine, but for some reason if I use
#pragma comment(lib,"../fmodapi375win/api/lib/fmodvc.lib")
instead it works the same as if that line wasn't there: it builds with no linker errors th...
From msdn I get this:
#pragma warning disable warning-list
#pragma warning restore warning-list
In the examples, both disable and restore are used. Is it necessary to restore if I want it disabled for a whole file?
Like, if I do not restore, how far does it carry? Are the warnings disabled for everything compiled after that? Or just ...
Various C / C++ compilers have #pragmas to control optimization.
For example:
CodeWarrior
#pragma optimization_level 0
void func_no_opt()
{
// Some Work - not optimized
}
#pragma optimization_level 3
void func_full_opt()
{
// Some Work - optimized
}
MSVC
#pragma optimize("g", off)
void func_no_opt()
{
// Some Work - no...
I'm attempting to perform a link of previously generated .obj files (using the latest version of MSVC).
When those .obj's were created, the source code specified:
#pragma comment(lib, ...)
As such, the linker is attempting to link against static libraries specified in the source. Is there a way to instruct the linker to ignore these...
There appears to be a new pragma named parent that does roughly the same thing as base. What does parent do that warrants a new (non-core) module? I am missing something?
...
The syntax for disabling warnings is as follows:
#pragma warning disable 414, 3021
Or, expressed more generally:
#pragma warning disable [CSV list of numeric codes]
Is there a list of these numeric codes and the description of the warning that they're suppressing? Much to my chagrin, I can't seem to locate it via Google.
...
I've got a project where I've just discovered that warning C4244 (possible loss of data) is being suppressed. I strongly suspect that some crummy MS header is suppressing this warning and leaving it suppressed for all translation units that include said header, but I've not determined which of their myriad headers may be at fault.
So, ...
I'm pretty sure this isn't a duplicate.
Do you use #pragma mark? I've seen multiple ways, which is correct?
#pragma mark -
#pragma mark === Actions ===
#pragma mark -
#pragma mark -
#pragma mark === Actions ===
#pragma mark - === Actions ===
#pragma mark Actions
? What is the way you do it?
How do you suggest dividing it up? What d...
I'm moving my C++ codebase from Visual Studio 2k3 to Visual Studio 2k8. Code contains
#pragma optimize( "a", on )
MSDN says that it means "assume no aliasing". Later versions of VS refuse to compile this and MSDN doesn't seem to say what to do with code containing this #pragma.
What does "assume no aliasing" mean and how to I make a ...
Is there a pragma or debugger attribute which will allow the debugger to not break on the throwing of a specific exception even though under the Debug >> Exceptions menu I've told it to break when any CLR Exceptions are throw?
In general while developing I like to have it break on exceptions while debugging so that I can immediately ins...
I have a templating system that looks similar to old-style ASP code. I run this through a class that rewrites the entire thing into C# source code, compiles, and finally executes it.
What I'm wondering is if there is some kind of #pragma-like directive I can sprinkle the generated C# code with that will make compile errors match the lin...
What this C++ directive do: "#pragma GCC system_header"?
...
Is there a #pragma to have gcc/Xcode suppress specific warnings, similar to Java's @SuppressWarning annotation?
I compile with -Wall as a rule, but there are some situations where I'd like to just ignore a specific warning (e.g. while writing some quick/dirty code just to help debug something).
I'm not looking for "fix the code" answer...