cpphs and C++-style comments

Recent versions of cpphs also strip // comments in --strip mode, which causes problems with preprocessing Data.Array.Base, where (//) is an operator. It's necessary to strip C comments from that file, because it includes MachDeps.h, and that includes ghcautoconf.h, which being generated by autoconf has lots of C-style comments. (Though gcc's cpp strips them too -- I'm not sure how this ever worked.)

On Thu, Sep 13, 2007 at 01:31:52PM +0100, Ross Paterson wrote:
Recent versions of cpphs also strip // comments in --strip mode,
(Though gcc's cpp strips them too -- I'm not sure how this ever worked.)
"gcc -E -traditional" doesn't strip them; that's how it works in GHC at least. Thanks Ian

Ross Paterson wrote:
Recent versions of cpphs also strip // comments in --strip mode,
Ian Lynagh
"gcc -E -traditional" doesn't strip them; that's how it works in GHC at least.
Would you like to have separate option flags in cpphs for stripping the different kinds of C comment? e.g. --strip and --stripAnsi? Regards, Malcolm

On Thu, Sep 13, 2007 at 02:13:18PM +0100, Malcolm Wallace wrote:
Would you like to have separate option flags in cpphs for stripping the different kinds of C comment? e.g. --strip and --stripAnsi?
Separate options would resuscitate the Hugs build, so yes please. As for the name, camel-case is not the usually used for options, and might ANSI some day bless C99? How about --strip-traditional or --strip-c89?

Would you like to have separate option flags in cpphs for stripping the different kinds of C comment? e.g. --strip and --stripAnsi?
Separate options would resuscitate the Hugs build, so yes please. How about --strip-traditional or --strip-c89?
OK, done. The new option is --strip-c89. Regards, Malcolm

On Fri, Sep 14, 2007 at 04:39:05PM +0100, Malcolm Wallace wrote:
Would you like to have separate option flags in cpphs for stripping the different kinds of C comment? e.g. --strip and --stripAnsi?
Separate options would resuscitate the Hugs build, so yes please. How about --strip-traditional or --strip-c89?
OK, done. The new option is --strip-c89.
Thanks. Now we have a conundrum: should Cabal 1.2 use the new option, and thus require the latest cpphs, or stick with the old option and be broken with the new cpphs? Cabal only invokes cpphs for non-GHC builds, so I'd say use it.

In message <20070914171244.GA11741@soi.city.ac.uk> libraries@haskell.org, cabal-devel@haskell.org writes:
On Fri, Sep 14, 2007 at 04:39:05PM +0100, Malcolm Wallace wrote:
Would you like to have separate option flags in cpphs for stripping the different kinds of C comment? e.g. --strip and --stripAnsi?
Separate options would resuscitate the Hugs build, so yes please. How about --strip-traditional or --strip-c89?
OK, done. The new option is --strip-c89.
Thanks. Now we have a conundrum: should Cabal 1.2 use the new option, and thus require the latest cpphs, or stick with the old option and be broken with the new cpphs? Cabal only invokes cpphs for non-GHC builds, so I'd say use it.
Cabal knows the version of cpphs so it can use the new flag or the old one depending on the version of cpphs being used. Duncan

On Fri, Sep 14, 2007 at 06:38:41PM +0100, Duncan Coutts wrote:
In message <20070914171244.GA11741@soi.city.ac.uk> libraries@haskell.org, cabal-devel@haskell.org writes:
Thanks. Now we have a conundrum: should Cabal 1.2 use the new option, and thus require the latest cpphs, or stick with the old option and be broken with the new cpphs? Cabal only invokes cpphs for non-GHC builds, so I'd say use it.
Cabal knows the version of cpphs so it can use the new flag or the old one depending on the version of cpphs being used.
OK, so time to bump the version number of cpphs, then?

Ross Paterson
Thanks. Now we have a conundrum: should Cabal 1.2 use the new option, and thus require the latest cpphs, or stick with the old option and be broken with the new cpphs?
Hmm. There could be a better solution. Since no released version of cpphs has yet had the behaviour of stripping C eol // comments, (only the darcs version) there is still time to change the meaning of the flags. In particular, we could swap --strip back to mean what it used to mean (the current --strip-c89 behaviour), and find a new name for the eol-stripping flag. Thoughts? Regards, Malcolm

On Friday 14 September 2007 22:06, Malcolm Wallace wrote:
Hmm. There could be a better solution. Since no released version of cpphs has yet had the behaviour of stripping C eol // comments, (only the darcs version) there is still time to change the meaning of the flags. In particular, we could swap --strip back to mean what it used to mean (the current --strip-c89 behaviour), and find a new name for the eol-stripping flag.
That seems to be the right way IMHO. Even if Cabal could include a hack around the problem, we don't want to impose this ugliness upon other build systems people might use. Cheers, S.

Sven Panne
On Friday 14 September 2007 22:06, Malcolm Wallace wrote:
In particular, we could swap --strip back to mean what it used to mean (the current --strip-c89 behaviour), and find a new name for the eol-stripping flag.
That seems to be the right way IMHO.
OK, done. The new option name is --strip-eol, and --strip-c89 is gone. Regards, Malcolm

Malcolm Wallace wrote:
Sven Panne
wrote: On Friday 14 September 2007 22:06, Malcolm Wallace wrote:
In particular, we could swap --strip back to mean what it used to mean (the current --strip-c89 behaviour), and find a new name for the eol-stripping flag.
That seems to be the right way IMHO.
OK, done. The new option name is --strip-eol, and --strip-c89 is gone.
I'd rather name the flag --strip-cc or something like that, indicating that it refers to C++ comments (--strip-cpp might be misleading, though). Cheers Ben

Benjamin Franksen
OK, done. The new option name is --strip-eol, and --strip-c89 is gone.
I'd rather name the flag --strip-cc or something like that, indicating that it refers to C++ comments (--strip-cpp might be misleading, though).
How about --strip-c++ then? Regards, Malcolm
participants (6)
-
Benjamin Franksen
-
Duncan Coutts
-
Ian Lynagh
-
Malcolm Wallace
-
Ross Paterson
-
Sven Panne