pragma

How to disable #pragma warnings?

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...

Should I turn on Perl warnings with the command-line switch or pragma?

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 ...

use of #pragma in c

can u tell me usage of #pragma in c with an example ...

How long do you cache resources client side?

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?

Is there a way to set a pragma disable warning for visual studio for an entire solution? ...

Does anyone have a list of all the Visual Studio C# pragma names?

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? ...

Is there a way to disable all warnings with a pragma?

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...

Why isn't this library linking with a pragma comment?

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...

C#: Is pragma warning restore needed?

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 ...

What is the method for optimizing individual functions in a file in GCC 4.1.1?

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...

Ignore #pragma comment(lib, ...) ?

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...

What is the difference between parent and base in Perl 5?

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? ...

list of #pragma warning disable codes and what they mean

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. ...

VC++ Compiler: How to determine the current warning level or overrides?

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, ...

Xcode - Using #pragma mark

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...

How do I port code that contains #pragma optimize( "a" ) from VC++7 to VC++9 ?

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 ...

Any way in Visual Studio to not break on throwing of a specific exception?

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...

Is there any #pragma or similar directive for generated C# code to match template code line numbers to C# line number?

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...

C++ pragma directive

What this C++ directive do: "#pragma GCC system_header"? ...

Is there an gcc/Xcode pragma to suppress warnings?

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...