Is there a GCC pragma directive that will stop, halt, or abort the compilation process?
I am using GCC 4.1, but I would want the pragma to be available in GCC 3.x versions also.
The Gulf Cooperation Council (GCC) was established by an agreement concluded on 25 May 1981 in Riyadh, Saudi Arabia among Bahrain, Kuwait, Oman, Qatar, Saudi Arabia and UAE in view of their special relations, geographic proximity, similar political systems based on Islamic beliefs, joint destiny and common objectives.
Gulf Cooperation Council (GCC), political and economic alliance of six Middle Eastern countries—Saudi Arabia, Kuwait, the United Arab Emirates, Qatar, Bahrain, and Oman.
List of six Arab GCC (or AGCC) countries (Gulf countries), citizen nationalities, nations, or member states is Bahrain, Kuwait, Oman, Qatar, Saudi Arabia, UAE. Yemen and Iran are Muslim countries but not GCC members.
You probably want #error
:
$ cd /tmp $ g++ -Wall -DGoOn -o stopthis stopthis.cpp $ ./stopthis Hello, world $ g++ -Wall -o stopthis stopthis.cpp stopthis.cpp:7:6: error: #error I had enough
#include <iostream> int main(void) { std::cout << "Hello, world\n"; #ifndef GoOn #error I had enough #endif return 0; }
I do not know about a #pragma
, but #error
should do what you want:
#error Failing compilation
It will terminate compilation with the error message "Failing compilation".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With