This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]