Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-09-2005, 10:26 AM   #1
LQ Newbie
Registered: Nov 2004
Posts: 17

Rep: Reputation: 0
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.

Old 03-09-2005, 12:49 PM   #2
jim mcnamara
Registered: May 2002
Posts: 964

Rep: Reputation: 36
#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.
Old 03-09-2005, 02:24 PM   #3
Registered: Mar 2004
Location: Massachusetts
Distribution: Debian
Posts: 557

Rep: Reputation: 43
for warnnings and errors you can do #warning and #error.

the GCC poison pragma looks pretty cool too.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm looking for Linux equivalents to these programs please... TippyToes Linux - Software 3 11-11-2005 10:04 PM
Table of Equivalents: Windows & Linux Apps Compari Beetle B. Linux - Software 2 05-29-2005 04:27 PM
Linux software equivalents to... pertek Linux - Software 16 09-05-2004 02:26 AM
Linux equivalents: DVD organizer pingu Linux - Software 2 09-03-2004 08:18 PM
need win/linux software equivalents site rickenbacherus Linux - General 6 03-11-2003 08:30 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:26 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration