-   Programming (
-   -   Linux equivalents for #pragma (

DavidW567 03-09-2005 10:26 AM

Linux equivalents for #pragma
When I program for Windows, VC++. I can use two #pragma directives.

#pragma message()
such as
#pragma message( "Pentium processor build" )

to give a message while compiling. Good for debugging.


#pragma warning
such as
#pragma warning( disable : 4100 )

so that the compiler will ignore certain error messages.

Is there any equivalent in Linux.


jim mcnamara 03-09-2005 12:49 PM

#pragma is still used to a small degree.

Some of the pragmas are now the operator _Pragma.
Some are special specially defined, but still not pragmas.


You will have to scan the gcc man page to see if there are compiler options for what you want. There are no pragmas like that.

aluser 03-09-2005 02:24 PM

for warnnings and errors you can do #warning and #error.

the GCC poison pragma looks pretty cool too.

All times are GMT -5. The time now is 04:31 AM.