public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* can we define a comment?
@ 2006-05-16  2:41 Eric Fisher
       [not found] ` <2e393d080605152001l6b914fcu18a89db60d96ea4d@mail.gmail.com>
  2006-05-16  3:17 ` Burak Serdar
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Fisher @ 2006-05-16  2:41 UTC (permalink / raw)
  To: gcc-help

hi,
Anybody knows that if we can define a comment? For a statement such as,
   COMMENT this is a comment.
will be preprocessed as,
   // this is a comment.
or something valid and transparent to the compiler? Of cause we can't
directly use,
   #define COMMENT //

Thanks.
Eric.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: can we define a comment?
       [not found] ` <2e393d080605152001l6b914fcu18a89db60d96ea4d@mail.gmail.com>
@ 2006-05-16  3:09   ` Eric Fisher
  2006-05-16  3:43     ` David Fang
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Fisher @ 2006-05-16  3:09 UTC (permalink / raw)
  To: corey taylor, gcc-help

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)
>
> corey
>
> On 5/15/06, Eric Fisher <joefoxreal@gmail.com> wrote:
> > hi,
> > Anybody knows that if we can define a comment? For a statement such as,
> >   COMMENT this is a comment.
> > will be preprocessed as,
> >   // this is a comment.
> > or something valid and transparent to the compiler? Of cause we can't
> > directly use,
> >   #define COMMENT //
> >
> > Thanks.
> > Eric.
> >
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: can we define a comment?
  2006-05-16  2:41 can we define a comment? Eric Fisher
       [not found] ` <2e393d080605152001l6b914fcu18a89db60d96ea4d@mail.gmail.com>
@ 2006-05-16  3:17 ` Burak Serdar
  1 sibling, 0 replies; 4+ messages in thread
From: Burak Serdar @ 2006-05-16  3:17 UTC (permalink / raw)
  To: Eric Fisher; +Cc: gcc-help

How about

#define COMMENT /
...

COMMENT/  This is a comment.


On 5/15/06, Eric Fisher <joefoxreal@gmail.com> wrote:
> hi,
> Anybody knows that if we can define a comment? For a statement such as,
>    COMMENT this is a comment.
> will be preprocessed as,
>    // this is a comment.
> or something valid and transparent to the compiler? Of cause we can't
> directly use,
>    #define COMMENT //
>
> Thanks.
> Eric.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: can we define a comment?
  2006-05-16  3:09   ` Eric Fisher
@ 2006-05-16  3:43     ` David Fang
  0 siblings, 0 replies; 4+ messages in thread
From: David Fang @ 2006-05-16  3:43 UTC (permalink / raw)
  To: Eric Fisher; +Cc: corey taylor, gcc-help

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-05-16  3:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-16  2:41 can we define a comment? Eric Fisher
     [not found] ` <2e393d080605152001l6b914fcu18a89db60d96ea4d@mail.gmail.com>
2006-05-16  3:09   ` Eric Fisher
2006-05-16  3:43     ` David Fang
2006-05-16  3:17 ` Burak Serdar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).