Preprocessing directive like #error which doesn't stop compilation

S

Simon Biber

Alex Vinokur said:
Is there any preprocessing directive like #error which
doesn't stop compilation?

For instance,
# info text

There is none in standard C, but some compilers support #warning.
 
D

Darrell Grainger

Is there any preprocessing directive like #error which doesn't stop compilation?

There is nothing defined by the C standard but some compilers offer
non-standard preprocessor directives like #warning. Additionally, some
compilers will have a #pragma option for spitting out warnings or
comments.

You'll have to check your compiler documentation or ask in a newsgroup
that would be familar with your compiler.
 
D

Dan Pop

In said:
There is nothing defined by the C standard but some compilers offer
non-standard preprocessor directives like #warning. Additionally, some
compilers will have a #pragma option for spitting out warnings or
comments.

You'll have to check your compiler documentation or ask in a newsgroup
that would be familar with your compiler.

Even better, give up the idea. If the issue is not important enough to
warrant an #error, don't bother the user with unnecessary compilation
messages.

Dan
 
V

Vijay B

C does not provide a mechanism to let compilation proceed. However if
you are familiar with a bit of system programming then you can neglect
the signals (which in most cases caouse the program to abort). This is
very dangerous ...but if you are absolutely sure that you want to
block out signals then go ahead. This is done via the sigaction system
call . Take a look at the documentation for sigaction to see how to
block the signals. This is more of an OS thing rather than a C
language and is a solution for only Unix systems


Vijay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top