• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: //Comments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: //Comments


  • Subject: Re: //Comments
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Tue, 13 Jan 2009 23:26:54 +0100


Le 13 janv. 09 à 22:59, Steve Checkoway a écrit :

On Tue, Jan 13, 2009 at 02:46:17PM -0700, Jeff Laing wrote:
#define MACRO(a,b) something(a,b)

MACRO(
 firstarg,	 	// watch the pre-processor go thud
 secondarg )	// because of the above comment

The problem being that the // was not being recognised by the PREPROCESSOR as a comment, instead leaving it to the COMPILER to ignore them, but by the time the compiler saw the line, it looked like this for some reason:

something(firstarg //watch the pre-processor go thud, secondarg)

Not that standards seem to apply to VS much, but 6.10.3.10 of the standard (or at least the working draft linked in the previous email says, "Within the sequence of preprocessing tokens making up an invocation of a function-like macro, new-line is considered a normal white-space character."

Presumably, after expansion, it became:
something(firstarg, // watch the pre-processor go thud secondarg)

Does it said if it should strip the comments before or after macro expansion ?


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • RE: //Comments
      • From: "Jeff Laing" <email@hidden>
    • Re: //Comments
      • From: Steve Checkoway <email@hidden>
References: 
 >Re: //Comments (From: Fritz Anderson <email@hidden>)
 >RE: //Comments (From: "Jeff Laing" <email@hidden>)
 >Re: //Comments (From: Steve Checkoway <email@hidden>)

  • Prev by Date: Re: //Comments
  • Next by Date: Re: //Comments
  • Previous by thread: Re: //Comments
  • Next by thread: Re: //Comments
  • Index(es):
    • Date
    • Thread