Preprocessing directive like #error which doesn't stop compilation

Discussion in 'C Programming' started by Alex Vinokur, Jun 26, 2003.

  1. Alex Vinokur

    Alex Vinokur Guest

    Alex Vinokur, Jun 26, 2003
    #1
    1. Advertisements

  2. Alex Vinokur

    Simon Biber Guest

    There is none in standard C, but some compilers support #warning.
     
    Simon Biber, Jun 26, 2003
    #2
    1. Advertisements

  3. 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.
     
    Darrell Grainger, Jun 26, 2003
    #3
  4. Alex Vinokur

    Dan Pop Guest

    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
     
    Dan Pop, Jun 26, 2003
    #4
  5. Alex Vinokur

    Vijay B Guest

    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
     
    Vijay B, Jun 26, 2003
    #5
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.