This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: can we define a comment?
- From: David Fang <fang at csl dot cornell dot edu>
- To: Eric Fisher <joefoxreal at gmail dot com>
- Cc: corey taylor <corey dot taylor at gmail dot com>, <gcc-help at gcc dot gnu dot org>
- Date: Mon, 15 May 2006 23:43:12 -0400 (EDT)
- Subject: Re: can we define a comment?
> But, I don't want take this function-like way.
>
> 2006/5/16, corey taylor <corey.taylor@gmail.com>:
> > Kind of an odd request, but I suppose that you could do something like:
> >
> > #define CMNT(exp)
> >
> > But then you'd have to wrap the comment:
> >
> > CMNT(this is a comment)
If you insist on the following comment-style:
COMMENT ... stuff to read ...
you might as well pre-preprocess your source with another filter.
[Makefile]
# Converts .cpp-sed to .cpp file by applying sed filter.
.cpp-sed.cpp:
sed '/^COMMENT/d' $< > $@
[EOF]
This could be a poor-man's way of prepending your compile-chain with
another tool. (Generalize to your favorite scripting or
stream-editing language, if you like.)
BTW, 'm4' is another powerful preprocessor, whose comment-style is
programmable, if you really want some sophistication. (Probably overkill,
IMO.)
Fang