Top "Pragma" questions

The #pragma directives offer a way for each compiler to offer machine- and operating system-specific features while retaining overall compatibility with the C and C++ languages.

Where does the word "pragma" come from?

So I know what pragma is, and what it's used for, but what is the meaning of the word itself? …

c++ c terminology pragma
How to change optimization level of one function?

This is related to Determine cause of segfault when using -O3? In the question, I'm catching a segfault in a …

c gcc optimization pragma
Is there a pragma directive for include directories?

As the title says: Is there a pragma directive for include directories using VS20** C++? I think about something like: #…

c++ visual-studio include pragma
Code folding (#pragma region) in Qt creator

Is there something similar to explicit code regions for folding in Qt Creator: #pragma region Region_1 void Test() {} void Test2() {} …

c++ qt-creator pragma code-folding
Portable alternative to #pragma once

Can somebody tell me a workaround for #pragma once directive support for various compilers? I want to use in my …

c++ c pragma
Are there any preprocessor directives that control loop unrolling?

Furthermore, how does the compiler determine the extent to unroll a loop, assuming all operations in the loop are completely …

c++ visual-c++ pragma preprocessor-directive
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?

sqlite pragma
How to disable a specific nvcc compiler warnings

I want to disable a specific compiler warning with nvcc, specifically warning: NULL reference is not allowed The code I …

cuda compiler-warnings pragma nvcc
How to hint to GCC that a line should be unreachable at compile time?

It's common for compilers to provide a switch to warn when code is unreachable. I've also seen macros for some …

c gcc pragma built-in unreachable-code
GCC does not honor 'pragma GCC diagnostic' to silence warnings

We recently enabled -Wall for a project. Its enabled when GCC is at 4.7 or above (or Clang) because we can …

c++ gcc openmp compiler-warnings pragma