What is the difference between #pragma
and _Pragma()
in C?
syntax:
#pragma arg
and
_Pragma(arg)
When should I use _Pragma(arg)
?
What is the difference between #pragma
and _Pragma()
in C?
syntax:
#pragma arg
and
_Pragma(arg)
When should I use _Pragma(arg)
?
_Pragma
operator introduced inC99
._Pragma(arg)
is an operator, much likesizeof
ordefined
, and can be embedded in a macro.According to cpp.gnu.org reference:
According to IBM tutorial:
For more information about _pragma with example.
From here:
Also (same link):
So basically you can always use
#pragma
instead of__pragma()
. There is no need to use__pragma()
, but it can be used sometimes.