pragma

Pragmas swp,ivdep,prefetch support in various compilers

Hello In good Altix manual (altix_single_cpu_optimization) I've found this list of pragmas-hints for optimizing compilers #pragma ivdep // no aliasing #pragma swp // try to software-pipeline #pragma noswp // disable software-pipelining #pragma loop count (NN) // hint for SWP #pragma distr...

Can I enable/disable breaking on Exceptions programatically?

I want to be able to break on Exceptions when debugging... like in Visual Studio 2008's Menu Debug/Exception Dialog, except my program has many valid exceptions before I get to the bit I wish to debug. So instead of manually enabling and disabling it using the dialog every time is it possible to do it automatically with a #pragma or som...

How do people handle warning C4793: 'some_function' : function compiled as native?

I'm using the OpenCV library and one of its header files, cxoperations.hpp, generates "warning C4793: '`anonymous namespace'::CV_XADD' : function compiled as native", if my C++ project is compiled with CLR support. I can prevent the warning by surrounding the OpenCV header include like this: #pragma managed(push,off) #include <cv.h> #pr...

Using Pragma in Oracle Package Body

I'd like to create an Oracle Package and two functions in it: A public function ( function_public ) and a private one ( function_private ). The public function uses the private one in an sql statement. Without pragma the code does not compile (PLS-00231: function 'FUNCTION_PRIVATE' may not be used in SQL) CREATE OR REPLACE PACKAGE PRA...

When to use pragmas on sqlite?

When the pragmas are used? When the database is created for first time or in each connection to database? ...

C/C++ pragma in define macro

is there some way to embed pragma statement in macro with other statements? I am trying to achieve something like: #define DEFINE_DELETE_OBJECT(type) \ void delete_ ## type_(int handle); \ void delete_ ## type(int handle); \ #pragma weak de...

What could be adding "Pragma:no-cache" to my response Headers? (Apache, PHP)

I have a website whose maintenance I've inherited, which is a big hairy mess. One of the things i'm doing is improving performance. Among other things, I'm adding Expires headers to images. Now, there are some images that are served through a PHP file, and I notice that they do have the Expires header, but they also get loaded every tim...

What disables #pragma pack(push)?

Hi All, I have a code that uses #pragma pack(push,8) but it does not seem to take effect somehow but I can't figure out what's causing this problem. For example, look at the following code. #include <windows.h> #include <stdio.h> #pragma pack(push, 8) typedef struct _MY_DATA { LARGE_INTEGER a; LARGE_INTEGER b; ULONG count; } MY_D...

Removing Flag in GCC using Pragma

Hi, I want to remove a compiler flag for a praticular file in my project. How to do this using pragma? Thanks Dinesh P ...

Intentional compiler warnings for Visual C++ that appear in Error List?

How can you create a compiler warning (in the model of #error, except as a warning) on purpose in Visual C++ that will show up on the Error List with the correct file and line number? GCC and other compilers offer #warning, but the MSVC compiler does not. The "solution" at http://support.microsoft.com/kb/155196 does not parse in the Vi...

Is locale setting global in perl?

I'm debugging a perl script which looks like this (simplified): #!/usr/bin/perl use strict; use warnings; use Evil::Module; printf "%.3f\n", 0.1; This script outputs 0,100 (note , instead of .). If I comment out the use Evil::Module statement, the output will be 0.100. I believe that this is related to locale setting in the mod...

What is the use of #pragma warning in C#?

Hello I just saw this code #pragma warning disable 659, 660, 661 MSDN article is not helping much. What is the usage of this line? ...

Ada: optimize pragma

Hi, in the quest to make an Ada code run faster, I'm including the pragma optimize time in the code (in the declarative part). On compiling in AdaGIDE using the GNAT Ada libre Core compiler, I get a warning message: pragma Optimize(Time); | >>> warning: insufficient -O value In the Global settings in the AdaGIDE edit...

How to disable GCC warnings for a few lines of code

In Visual C++, it's possible to use #pragma warning (disable: ...). Also I found that in GCC you can override per file compiler flags. How can I do this for "next line", or with push/pop semantics around areas of code using GCC? ...

How to hint to GCC that a line should be unreachable?

It's common for compilers to provide a switch to warn when code is unreachable. I've also seen macros for some libraries, that provide assertions for unreachable code. Is there a hint, such as through a pragma, or builtin that I can pass to GCC (or any other compilers for that matter), that will warn or error during compilation if it's ...

Safari browser ignoring my no-cache

I'm unable to force a page to always expire in Safari. Chrome, IE and Firefox are good citizens but Safari is cruising along just fine with ignoring the following ASP.NET code: // Expire immediately Response.Expires = 0; Response.Cache.SetNoStore(); Response.AppendHeader("Pragma", "no-cache"); Any recommendations? ...

What is the reason for #pragma once inside header guards?

Just seen this inside <boost/asio.hpp> #ifndef BOOST_ASIO_HPP #define BOOST_ASIO_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) /// .... #endif // BOOST_ASIO_HPP Disregarding the _MSC_VER preprocessor checks, what is the benefit of having the #pragma once in this case...

Any way to group methods in Java/Eclipse?

I would like to be able to group similar methods and have them appear in my Outline view in Eclipse. This makes navigating large swaths of code a little easier on the eye, and easier to find methods you need. In Objective-C there was a pragma mark command that you could set. Anything like that for java/eclipse? ...

C++ Specify Headers Include Directory in Code

Is there a way to specify include directories in the code, perhaps via a #pragma? I have my project setup as "src/" and "include/" folders. I am trying to compile in Visual Studio 2010, but I don't want to set it up in the project settings. Is there another way to allow it to compile instead of having to specify the include as #includ...

How to call #pragma segment Foo on Garnet OS

I've read this excellent tutorial about segments in palm: http://onboardc.sourceforge.net/UsersManual.html#segments But developing with Garnet OS Development Suite, the command "#pragma segment Foo" isn't recognized by the compiler, it warns me: "Warning: ignoring pragma" Is there an option to enable this pragma segment? ...