Invalid ## arguments in _VAR_TYPE in xstddef - by Steve Cornett

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 712897 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 12/9/2011 4:45:49 PM
Access Restriction Public


In the header xstddef there is a macro named _VAR_TYPE that contains an invalid usage of the ## operator:

#define _VAR_VAL(NUM)   \
    _V ## NUM
#define _VAR_TYPE(NUM)  \
    _VAR_VAL(NUM) ## _t

This usage pastes the ')' token with the result of expanding _t, which can never form a valid token, and is not the apparent intention. The problem can be corrected with the definition below. This change is the resolution to this bug:

#define _VAR_TYPE(NUM)  \
    _V ## NUM ## _t

The symptom of the problem does not occur with Microsoft C++ alone, but occurs when the code is preprocessed by another product such as our product, BullseyeCoverage. You can also demonstrate the problem by expanding the macro with another compiler such as GCC 4.5.2, or Embarcadero C++ 6.42.

For additional info, see
Sign in to post a comment.
Posted by Microsoft on 1/18/2012 at 8:17 PM

Thanks for reporting this bug. We've fixed it (in both _VAR_TYPE and _VAR_TYPEX), and the fix will be available in VC11.

If you have any further questions, feel free to E-mail me at .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by MS-Moderator08 [Feedback Moderator] on 12/11/2011 at 10:15 PM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by MS-Moderator01 on 12/9/2011 at 5:43 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(