C++ Precompiler: Same as C Precompiler?

Discussion in 'C++' started by JohnQ, Jun 11, 2007.

  1. JohnQ

    JohnQ Guest

    Is the C++ precompiler the same as a C precompiler? If not, how much
    different is it?

    John
    JohnQ, Jun 11, 2007
    #1
    1. Advertising

  2. JohnQ wrote:
    > Is the C++ precompiler the same as a C precompiler? If not, how much
    > different is it?


    I wonder if :

    #define ABC( A, B )

    ABC( std::map<T1,T2>, B )

    is supposed to work in future C++ standard pre processors ?
    Gianni Mariani, Jun 11, 2007
    #2
    1. Advertising

  3. JohnQ

    Jerry Coffin Guest

    In article <xC0bi.7601$>,
    says...
    > Is the C++ precompiler the same as a C precompiler? If not, how much
    > different is it?


    At least officially, they're currently different -- C99 added variadic
    macros (for one example) that C++ doesn't have (yet). I believe the
    intent is to add these in C++ 0x so they'll be the same again.

    --
    Later,
    Jerry.

    The universe is a figment of its own imagination.
    Jerry Coffin, Jun 11, 2007
    #3
  4. JohnQ

    JohnQ Guest

    "Jerry Coffin" <> wrote in message
    news:...
    > In article <xC0bi.7601$>,
    > says...
    >> Is the C++ precompiler the same as a C precompiler? If not, how much
    >> different is it?

    >
    > At least officially, they're currently different -- C99 added variadic
    > macros (for one example) that C++ doesn't have (yet). I believe the
    > intent is to add these in C++ 0x so they'll be the same again.\


    Oh! So the C precompiler is "more advanced" then the C++ one. I kinda like
    that response. I hope the implication is a correct one.

    John
    JohnQ, Jun 11, 2007
    #4
  5. JohnQ

    Ian Collins Guest

    JohnQ wrote:
    > "Jerry Coffin" <> wrote in message
    > news:...
    >> In article <xC0bi.7601$>,
    >> says...
    >>> Is the C++ precompiler the same as a C precompiler? If not, how much
    >>> different is it?

    >> At least officially, they're currently different -- C99 added variadic
    >> macros (for one example) that C++ doesn't have (yet). I believe the
    >> intent is to add these in C++ 0x so they'll be the same again.\

    >
    > Oh! So the C precompiler is "more advanced" then the C++ one. I kinda like
    > that response. I hope the implication is a correct one.
    >

    Preprocessor.

    Don't forget that a) C99 isn't fully implemented by most C compilers and
    b) variadic macros are of more use in C than they are in C++.

    --
    Ian Collins.
    Ian Collins, Jun 11, 2007
    #5
  6. JohnQ

    Jerry Coffin Guest

    In article <h53bi.18026$>,
    says...

    [ ... ]

    > Oh! So the C precompiler is "more advanced" then the C++ one. I kinda like
    > that response. I hope the implication is a correct one.


    Keep in mind that I said "officially". I said it for a reason --
    conforming implementations of C99 are pretty rare, and the only one of
    which I'm aware (Comeau) also allows you to use the new preprocessor
    when compiling C++ code if you want to; from a practical viewpoint,
    there's not a whole lot of difference.

    That said, yes, the C preprocessor is currently more advanced than the
    C++ preprocessor.

    --
    Later,
    Jerry.

    The universe is a figment of its own imagination.
    Jerry Coffin, Jun 11, 2007
    #6
  7. JohnQ

    JohnQ Guest

    "Jerry Coffin" <> wrote in message
    news:...
    > In article <h53bi.18026$>,
    > says...
    >
    > [ ... ]
    >
    >> Oh! So the C precompiler is "more advanced" then the C++ one. I kinda
    >> like
    >> that response. I hope the implication is a correct one.

    >
    > Keep in mind that I said "officially". I said it for a reason --
    > conforming implementations of C99 are pretty rare, and the only one of
    > which I'm aware (Comeau) also allows you to use the new preprocessor
    > when compiling C++ code if you want to; from a practical viewpoint,
    > there's not a whole lot of difference.
    >
    > That said, yes, the C preprocessor is currently more advanced than the
    > C++ preprocessor.


    Ha! My thought was in hacking an existing precompiler (HP PCC, yeah way back
    there), and replacing the one that came with VC++ maybe to harness the
    templates concept to my liking?

    John
    JohnQ, Jun 11, 2007
    #7
  8. JohnQ

    JohnQ Guest

    "Ian Collins" <> wrote in message
    news:...
    > JohnQ wrote:
    >> "Jerry Coffin" <> wrote in message
    >> news:...
    >>> In article <xC0bi.7601$>,
    >>> says...
    >>>> Is the C++ precompiler the same as a C precompiler? If not, how much
    >>>> different is it?
    >>> At least officially, they're currently different -- C99 added variadic
    >>> macros (for one example) that C++ doesn't have (yet). I believe the
    >>> intent is to add these in C++ 0x so they'll be the same again.\

    >>
    >> Oh! So the C precompiler is "more advanced" then the C++ one. I kinda
    >> like
    >> that response. I hope the implication is a correct one.
    >>

    > Preprocessor.
    >
    > Don't forget that a) C99 isn't fully implemented by most C compilers and
    > b) variadic macros are of more use in C than they are in C++.


    Aside: I'm not worried about variadic macros. The only thing I'm "worried
    about" is the C++ precompiler supporting C++isms (of only any that I use, of
    course).

    John
    JohnQ, Jun 11, 2007
    #8
  9. JohnQ

    Ian Collins Guest

    JohnQ wrote:
    > "Ian Collins" <> wrote in message
    > news:...
    >> JohnQ wrote:
    >>> "Jerry Coffin" <> wrote in message
    >>> news:...
    >>>> In article <xC0bi.7601$>,
    >>>> says...
    >>>>> Is the C++ precompiler the same as a C precompiler? If not, how much
    >>>>> different is it?
    >>>> At least officially, they're currently different -- C99 added variadic
    >>>> macros (for one example) that C++ doesn't have (yet). I believe the
    >>>> intent is to add these in C++ 0x so they'll be the same again.\
    >>> Oh! So the C precompiler is "more advanced" then the C++ one. I kinda
    >>> like
    >>> that response. I hope the implication is a correct one.
    >>>

    >> Preprocessor.
    >>
    >> Don't forget that a) C99 isn't fully implemented by most C compilers and
    >> b) variadic macros are of more use in C than they are in C++.

    >
    > Aside: I'm not worried about variadic macros. The only thing I'm "worried
    > about" is the C++ precompiler supporting C++isms (of only any that I use, of
    > course).
    >

    Are you talking about some specific "precompiler" (if so, which?), or
    the C++ preprocessor?

    --
    Ian Collins.
    Ian Collins, Jun 11, 2007
    #9
  10. "JohnQ" asked:

    > Is the C++ precompiler the same as a C precompiler?
    > If not, how much different is it?


    There is no such thing as a "precompiler" in C or C++.
    They are not "JIT" languages. Are you a Java programmer,
    by any chance?

    Or perhaps you mean the "preprocessor"? That is just a text
    editor. It is not *any* kind of "compiler", pre-, post-,
    or otherwise. It just edits text. No more, no less.

    And yes, as far as I can tell, it's pretty much the same
    for C and C++. There may be minor differences. Buy and
    read the C and C++ standards, if you want the gory details:

    http://webstore.ansi.org/ansidocstore/

    They're cheap (at least, the electronic versions are)
    and they answer many questions.

    --
    Cheers,
    Robbie Hatley
    lonewolf aatt well dott com
    triple-dubya dott tustinfreezone dott org
    Robbie Hatley, Jun 11, 2007
    #10
  11. JohnQ

    JohnQ Guest

    "Ian Collins" <> wrote in message
    news:...
    > JohnQ wrote:
    >> "Ian Collins" <> wrote in message
    >> news:...
    >>> JohnQ wrote:
    >>>> "Jerry Coffin" <> wrote in message
    >>>> news:...
    >>>>> In article <xC0bi.7601$>,
    >>>>> says...
    >>>>>> Is the C++ precompiler the same as a C precompiler? If not, how much
    >>>>>> different is it?
    >>>>> At least officially, they're currently different -- C99 added variadic
    >>>>> macros (for one example) that C++ doesn't have (yet). I believe the
    >>>>> intent is to add these in C++ 0x so they'll be the same again.\
    >>>> Oh! So the C precompiler is "more advanced" then the C++ one. I kinda
    >>>> like
    >>>> that response. I hope the implication is a correct one.
    >>>>
    >>> Preprocessor.
    >>>
    >>> Don't forget that a) C99 isn't fully implemented by most C compilers and
    >>> b) variadic macros are of more use in C than they are in C++.

    >>
    >> Aside: I'm not worried about variadic macros. The only thing I'm "worried
    >> about" is the C++ precompiler supporting C++isms (of only any that I use,
    >> of
    >> course).
    >>

    > Are you talking about some specific "precompiler" (if so, which?), or
    > the C++ preprocessor?


    The C++ one. I'm using VC++ but I recently found HP PCC and am wondering if
    I can get some freedom via that.

    John
    JohnQ, Jun 11, 2007
    #11
  12. JohnQ

    JohnQ Guest

    "Robbie Hatley" <> wrote in message
    news:7o6bi.80331$...
    >
    > "JohnQ" asked:
    >
    >> Is the C++ precompiler the same as a C precompiler?
    >> If not, how much different is it?

    >
    > There is no such thing as a "precompiler" in C or C++.
    > They are not "JIT" languages. Are you a Java programmer,
    > by any chance?
    >
    > Or perhaps you mean the "preprocessor"?


    Yes, that's exactly what I meant. My bad.

    John
    JohnQ, Jun 11, 2007
    #12
  13. JohnQ

    Ian Collins Guest

    JohnQ wrote:
    > "Ian Collins" <> wrote:
    >
    >> Are you talking about some specific "precompiler" (if so, which?), or
    >> the C++ preprocessor?

    >
    > The C++ one. I'm using VC++ but I recently found HP PCC and am wondering if
    > I can get some freedom via that.
    >

    Then you are not talking about a "precompiler".

    --
    Ian Collins.
    Ian Collins, Jun 11, 2007
    #13
  14. JohnQ

    James Kanze Guest

    On Jun 11, 2:24 am, "JohnQ" <>
    wrote:
    > Is the C++ precompiler the same as a C precompiler?


    No, but I think it will be with the next release of the
    standard. There is a very extensive common subset, however.

    > If not, how much different is it?


    C++ doesn't have any of the features what were added in C99.
    Things like a variable number of arguments for macros.

    There are also small differences with regards to predefined
    symbols: C doesn't (and won't) have __cplusplus, for example.
    This is intentional.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
    James Kanze, Jun 11, 2007
    #14
  15. JohnQ

    JohnQ Guest

    "Ian Collins" <> wrote in message
    news:...
    > JohnQ wrote:
    >> "Ian Collins" <> wrote:
    >>
    >>> Are you talking about some specific "precompiler" (if so, which?), or
    >>> the C++ preprocessor?

    >>
    >> The C++ one. I'm using VC++ but I recently found HP PCC and am wondering
    >> if
    >> I can get some freedom via that.
    >>

    > Then you are not talking about a "precompiler".


    I know, it was "a typo". 'preprocessor' is what I meant.

    John
    JohnQ, Jun 12, 2007
    #15
  16. JohnQ

    JohnQ Guest

    "James Kanze" <> wrote in message
    news:...
    On Jun 11, 2:24 am, "JohnQ" <>
    wrote:
    > Is the C++ precompiler the same as a C precompiler?


    "No, but I think it will be with the next release of the
    standard. There is a very extensive common subset, however."

    > If not, how much different is it?


    "C++ doesn't have any of the features what were added in C99.
    Things like a variable number of arguments for macros.

    There are also small differences with regards to predefined
    symbols: C doesn't (and won't) have __cplusplus, for example.
    This is intentional."


    So templates are implemented strictly in the compiler then or is that
    implementation-specific?


    (Aside: Your post's header info contains:
    Content-Type: text/plain; charset="us-ascii"
    Content-Transfer-Encoding: quoted-printable <<-- Is this the problem?)

    John
    JohnQ, Jun 12, 2007
    #16
  17. JohnQ

    Ian Collins Guest

    JohnQ wrote:
    >
    > So templates are implemented strictly in the compiler then or is that
    > implementation-specific?
    >

    They have to be implemented by the compiler. Templates use types and
    the preprocessor being a simple text processor has no concept to type.

    --
    Ian Collins.
    Ian Collins, Jun 12, 2007
    #17
  18. JohnQ

    JohnQ Guest

    "Ian Collins" <> wrote in message
    news:...
    > JohnQ wrote:
    >>
    >> So templates are implemented strictly in the compiler then or is that
    >> implementation-specific?
    >>

    > They have to be implemented by the compiler. Templates use types and
    > the preprocessor being a simple text processor has no concept to type.


    Explain/prove please.

    John
    JohnQ, Jun 12, 2007
    #18
  19. JohnQ

    Ian Collins Guest

    JohnQ wrote:
    > "Ian Collins" <> wrote in message
    > news:...
    >> JohnQ wrote:
    >>> So templates are implemented strictly in the compiler then or is that
    >>> implementation-specific?
    >>>

    >> They have to be implemented by the compiler. Templates use types and
    >> the preprocessor being a simple text processor has no concept to type.

    >
    > Explain/prove please.
    >

    Oh come on, have you read an C++ books?

    --
    Ian Collins.
    Ian Collins, Jun 12, 2007
    #19
  20. JohnQ

    JohnQ Guest

    "Ian Collins" <> wrote in message
    news:...
    > JohnQ wrote:
    >> "Ian Collins" <> wrote in message
    >> news:...
    >>> JohnQ wrote:
    >>>> So templates are implemented strictly in the compiler then or is that
    >>>> implementation-specific?
    >>>>
    >>> They have to be implemented by the compiler. Templates use types and
    >>> the preprocessor being a simple text processor has no concept to type.

    >>
    >> Explain/prove please.
    >>

    > Oh come on, have you read an C++ books?


    See my example in one of my latest post in the thread "Re: Are C++ templates
    a precompiler thing?" and tell me how it is not type safe. (slink example).
    Continue dialog there rather than here unless you can prove what you said
    above and want to follow up on that here. Thanks.

    John
    JohnQ, Jun 12, 2007
    #20
    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. Loane Sharp

    precompiler error

    Loane Sharp, Dec 26, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    478
    Loane Sharp
    Dec 26, 2004
  2. Suzanne Vogel
    Replies:
    2
    Views:
    2,616
    Suzanne Vogel
    Jun 26, 2003
  3. Martin Stich

    Precompiler question

    Martin Stich, Dec 2, 2003, in forum: C++
    Replies:
    7
    Views:
    408
    Chris Theis
    Dec 3, 2003
  4. Werner Nussbaumer

    C Precompiler/Preprocessor Source Code

    Werner Nussbaumer, Mar 5, 2004, in forum: C++
    Replies:
    1
    Views:
    6,079
    Rolf Magnus
    Mar 5, 2004
  5. Kulgan

    ASP.NET Precompiler Not Working

    Kulgan, Feb 13, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    355
    Kulgan
    Feb 15, 2007
Loading...

Share This Page