#warning preprocessor command

Discussion in 'C Programming' started by ddehterov@gmail.com, Jun 29, 2006.

  1. Guest

    Hello,

    I'm wondering, is #warning preprocessor command is documented in
    standart C
    or it's implementation specific? I cannot find any documentation about
    it.
    It works with gcc on freebsd and linux.

    --
    Dmitri
    , Jun 29, 2006
    #1
    1. Advertising

  2. wrote:
    > Hello,
    >
    > I'm wondering, is #warning preprocessor command is documented in
    > standart C
    > or it's implementation specific? I cannot find any documentation about
    > it.
    > It works with gcc on freebsd and linux.


    Standard C defines the #error directive, #warning is a GNU extension.

    Robert Gamble
    Robert Gamble, Jun 29, 2006
    #2
    1. Advertising

  3. writes:
    > I'm wondering, is #warning preprocessor command is documented in
    > standart C or it's implementation specific? I cannot find any
    > documentation about it. It works with gcc on freebsd and linux.


    It's implementation specific.

    The standard preprocessor directives are:

    #include
    #define
    #undef
    #line
    #error
    #pragma
    #

    The latter is a null directive; it has no effect.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
    Keith Thompson, Jun 29, 2006
    #3
  4. Keith Thompson wrote:
    > writes:
    > > I'm wondering, is #warning preprocessor command is documented in
    > > standart C or it's implementation specific? I cannot find any
    > > documentation about it. It works with gcc on freebsd and linux.

    >
    > It's implementation specific.
    >
    > The standard preprocessor directives are:
    >
    > #include
    > #define
    > #undef
    > #line
    > #error
    > #pragma
    > #
    >
    > The latter is a null directive; it has no effect.


    #if, #ifdef, #ifndef, #elif, #else, and #endif are preprocessing
    directive too.

    Robert Gamble
    Robert Gamble, Jun 29, 2006
    #4
  5. "Robert Gamble" <> writes:
    > Keith Thompson wrote:
    >> writes:
    >> > I'm wondering, is #warning preprocessor command is documented in
    >> > standart C or it's implementation specific? I cannot find any
    >> > documentation about it. It works with gcc on freebsd and linux.

    >>
    >> It's implementation specific.
    >>
    >> The standard preprocessor directives are:
    >>
    >> #include
    >> #define
    >> #undef
    >> #line
    >> #error
    >> #pragma
    >> #
    >>
    >> The latter is a null directive; it has no effect.

    >
    > #if, #ifdef, #ifndef, #elif, #else, and #endif are preprocessing
    > directive too.


    Sure, but they don't really count, because they aren't on the page I
    was looking at.

    In other words, oops.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
    Keith Thompson, Jun 29, 2006
    #5
  6. Skarmander Guest

    Keith Thompson wrote:
    > "Robert Gamble" <> writes:
    >> Keith Thompson wrote:
    >>> writes:
    >>>> I'm wondering, is #warning preprocessor command is documented in
    >>>> standart C or it's implementation specific? I cannot find any
    >>>> documentation about it. It works with gcc on freebsd and linux.
    >>> It's implementation specific.
    >>>
    >>> The standard preprocessor directives are:
    >>>
    >>> #include
    >>> #define
    >>> #undef
    >>> #line
    >>> #error
    >>> #pragma
    >>> #
    >>>
    >>> The latter is a null directive; it has no effect.

    >> #if, #ifdef, #ifndef, #elif, #else, and #endif are preprocessing
    >> directive too.

    >
    > Sure, but they don't really count, because they aren't on the page I
    > was looking at.
    >
    > In other words, oops.
    >

    I would have made that "those are not in *my* copy of the standard".

    The requisite follow-up could have included a dog.

    S.
    Skarmander, Jun 29, 2006
    #6
  7. Skarmander <> writes:
    > Keith Thompson wrote:
    >> "Robert Gamble" <> writes:
    >>> Keith Thompson wrote:
    >>>> writes:
    >>>>> I'm wondering, is #warning preprocessor command is documented in
    >>>>> standart C or it's implementation specific? I cannot find any
    >>>>> documentation about it. It works with gcc on freebsd and linux.
    >>>> It's implementation specific.
    >>>>
    >>>> The standard preprocessor directives are:
    >>>>
    >>>> #include
    >>>> #define
    >>>> #undef
    >>>> #line
    >>>> #error
    >>>> #pragma
    >>>> #
    >>>>
    >>>> The latter is a null directive; it has no effect.
    >>> #if, #ifdef, #ifndef, #elif, #else, and #endif are preprocessing
    >>> directive too.

    >> Sure, but they don't really count, because they aren't on the page I
    >> was looking at.
    >> In other words, oops.
    >>

    > I would have made that "those are not in *my* copy of the standard".
    >
    > The requisite follow-up could have included a dog.


    Yes, the dog (well, more likely a cat) ate that page of my PDF file.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
    Keith Thompson, Jun 29, 2006
    #7
  8. Guest

    Robert Gamble wrote:
    > wrote:
    > > Hello,
    > >
    > > I'm wondering, is #warning preprocessor command is documented in
    > > standart C
    > > or it's implementation specific? I cannot find any documentation about
    > > it.
    > > It works with gcc on freebsd and linux.

    >
    > Standard C defines the #error directive, #warning is a GNU extension.


    Thanks.

    >
    > Robert Gamble


    Dmitri
    , Jun 30, 2006
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cronus
    Replies:
    1
    Views:
    658
    Paul Mensonides
    Jul 15, 2004
  2. Shea Martin
    Replies:
    8
    Views:
    3,216
    Victor Bazarov
    Dec 8, 2004
  3. vinayby
    Replies:
    2
    Views:
    266
    Michael Mair
    Jan 22, 2006
  4. Boris Kuznetsov
    Replies:
    5
    Views:
    3,652
    Ron Natalie
    Sep 12, 2005
  5. Spiro Trikaliotis

    Extra characters on preprocessor line - error or warning?

    Spiro Trikaliotis, Nov 29, 2008, in forum: C Programming
    Replies:
    0
    Views:
    477
    Spiro Trikaliotis
    Nov 29, 2008
Loading...

Share This Page