#pragma once in ISO standard yet?

Discussion in 'C++' started by Rick, Dec 12, 2007.

  1. Rick

    Rick Guest

    I'm told that "#pragma once" has made it into the ISO standard for
    either C or C++. I can't find any reference to that anywhere. If
    it's true, do any of you have a reference I can use?

    Thanks...
     
    Rick, Dec 12, 2007
    #1
    1. Advertising

  2. On Dec 13, 2:20 am, Rick <> wrote:
    > I'm told that "#pragma once" has made it into the ISO standard for
    > either C or C++. I can't find any reference to that anywhere. If
    > it's true, do any of you have a reference I can use?


    I am not sure about the standardization. I have N2135 (from
    2006-11-06) and it does not say anything about pragma once. Although,
    it does say pragma directives cause implementation to behave in an
    implementation defined manner. In any case, the standard include
    guards are capable of the compile time optimization that pragma once
    could do, atleast as in gcc. So, it is not really necessary to use
    them instead making them redundant.
     
    Abhishek Padmanabh, Dec 13, 2007
    #2
    1. Advertising

  3. Rick

    Guest

    On Dec 12, 4:20 pm, Rick <> wrote:
    > I'm told that "#pragma once" has made it into the ISO standard for
    > either C or C++. I can't find any reference to that anywhere. If
    > it's true, do any of you have a reference I can use?
    >
    > Thanks...


    I have not heard that it will be included into standard. Just for your
    information - "#pragma once" is not recognized by all preprocessors,
    so you cannot rely on it in a portable program. It is not supported by
    GCC from version 3.4. You can read more by following these links:

    http://gcc.gnu.org/ml/gcc/2003-02/msg00294.html
    http://lists.apple.com/archives/darwin-development/2003/Feb/msg00084.html

    Vlady.
     
    , Dec 13, 2007
    #3
  4. Rick

    Pete Becker Guest

    On 2007-12-13 07:02:42 -0500, said:

    > On Dec 12, 4:20 pm, Rick <> wrote:
    >> I'm told that "#pragma once" has made it into the ISO standard for
    >> either C or C++. I can't find any reference to that anywhere. If
    >> it's true, do any of you have a reference I can use?
    >>
    >> Thanks...

    >
    > I have not heard that it will be included into standard. Just for your
    > information - "#pragma once" is not recognized by all preprocessors,
    > so you cannot rely on it in a portable program. It is not supported by
    > GCC from version 3.4. You can read more by following these links:
    >
    > http://gcc.gnu.org/ml/gcc/2003-02/msg00294.html
    > http://lists.apple.com/archives/darwin-development/2003/Feb/msg00084.html
    >


    It is not in the C++ standard, nor has it been proposed. Experience
    indicates that it's not as useful as it appears at first glance, which
    is why GCC dropped it.

    --
    Pete
    Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
    Standard C++ Library Extensions: a Tutorial and Reference
    (www.petebecker.com/tr1book)
     
    Pete Becker, Dec 13, 2007
    #4
  5. Rick

    Pete Becker Guest

    On 2007-12-13 08:56:59 -0500, Pete Becker <> said:

    >
    > It is not in the C++ standard, nor has it been proposed. Experience
    > indicates that it's not as useful as it appears at first glance, which
    > is why GCC dropped it.


    That is, GCC now considers it "obsolete".

    --
    Pete
    Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
    Standard C++ Library Extensions: a Tutorial and Reference
    (www.petebecker.com/tr1book)
     
    Pete Becker, Dec 13, 2007
    #5
    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. Franck DARRAS
    Replies:
    12
    Views:
    659
    Jim Higson
    Aug 23, 2004
  2. Jacob Jensen

    pragma once

    Jacob Jensen, Apr 3, 2004, in forum: C++
    Replies:
    14
    Views:
    8,598
    Julie
    Apr 5, 2004
  3. Rick

    #pragma once in ISO standard yet?

    Rick, Dec 12, 2007, in forum: C Programming
    Replies:
    33
    Views:
    1,256
    CBFalconer
    Dec 15, 2007
  4. raashid bhatt

    What is #pragma once used for

    raashid bhatt, Mar 27, 2008, in forum: C++
    Replies:
    7
    Views:
    988
    Andy Champ
    Mar 27, 2008
  5. Subrat
    Replies:
    3
    Views:
    808
    James Kanze
    Jul 2, 2008
Loading...

Share This Page