LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Linux equivalents for #pragma (https://www.linuxquestions.org/questions/programming-9/linux-equivalents-for-pragma-299592/)

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.

And

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

so that the compiler will ignore certain error messages.

Is there any equivalent in Linux.

David

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.

see: http://www.ugcs.caltech.edu/info/gcc/cpp_7.html

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.