// and \ (was Re: Software maintenance)
- From: Kenneth Brody <kenbrody@xxxxxxxxxxx>
- Date: Wed, 22 Sep 2010 10:32:08 -0400
On 9/21/2010 3:52 PM, Seebs wrote:
On 2010-09-21, Keith Thompson<kst-u@xxxxxxx> wrote:Seebs<usenet-nospam@xxxxxxxxx> writes:I have never seen \ at end of line used by anything but mechanical
code processors.
I think you're forgetting about multi-line macro definitions.
You're right, obviously I am.
And I've even seen comments used in them. Although I think always
/**/ comments.
I don't think I've ever used comments _within_ a multi-line macro definition.
But, my mind comes up with all sorts of weird "what if" questions when reading threads such as this, even though I would probably never use code like this...
What does the standard say of "\" at the end of a line with a "//" comment? My compiler gives a warning, but "continues" the comment onto the next line:
char *pt = "This is a line" // comment \
"(foo)" \
"(bar)"
"(baz)";
I get this warning twice:
single-line comment contains line-continuation character
and the string contains "This is a line(baz)".
Ditto for gcc (with "-Wall"), though the warning is worded
warning: multiline `//' comment
I know that compilers are allowed to give any "warnings" that they like (for example, "warning: 'int i;' is cliche" would be perfectly legal), but "inquiring minds want to know".
--
Kenneth Brody
.
- Follow-Ups:
- Re: // and \ (was Re: Software maintenance)
- From: Keith Thompson
- Re: // and \ (was Re: Software maintenance)
- References:
- Re: Software maintenance
- From: Brian
- Re: Software maintenance
- From: Malcolm McLean
- Re: Software maintenance
- From: Ian Collins
- Re: Software maintenance
- From: Seebs
- Re: Software maintenance
- From: Malcolm McLean
- Re: Software maintenance
- From: Vincenzo Mercuri
- Re: Software maintenance
- From: Keith Thompson
- Re: Software maintenance
- From: Vincenzo Mercuri
- Re: Software maintenance
- From: Shao Miller
- Re: Software maintenance
- From: Vincenzo Mercuri
- Re: Software maintenance
- From: Keith Thompson
- Re: Software maintenance
- From: jacob navia
- Re: Software maintenance
- From: Nobody
- Re: Software maintenance
- From: jacob navia
- Re: Software maintenance
- From: Ralf Damaschke
- Re: Software maintenance
- From: jacob navia
- Re: Software maintenance
- From: Nobody
- Re: Software maintenance
- From: jacob navia
- Re: Software maintenance
- From: Seebs
- Re: Software maintenance
- From: Keith Thompson
- Re: Software maintenance
- From: Seebs
- Re: Software maintenance
- Prev by Date: Re: i = 10; result = ++i - --i; How result become ZERO
- Next by Date: Re: KR1 Still up-to-date?
- Previous by thread: Re: Software maintenance
- Next by thread: Re: // and \ (was Re: Software maintenance)
- Index(es):
Relevant Pages
|