Useless line of code in AtlSafeRealloc() - by Dmitry Me

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.


1
0
Sign in
to vote
ID 714790 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 12/20/2011 12:33:53 AM
Access Restriction Public
Moderator Decision Sent to Engineering Team for consideration

Description

This behavior is observed in version 10.0.40219.1 SP1Rel

atlbase.h contains this code:

_Ret_opt_count_(cEls) T* AtlSafeRealloc(
	_In_opt_ T* pT,
	_In_ size_t cEls) throw()
{
       //whatever, then finally 
	pT = pTemp;
	return pTemp;
}

the line "pT=pTemp" makes no sense - it modifies the function parameter which is passed by value, the new value is never used, so it will be discarded during compilation. The line does exactly nothing and is completely useless and should be eliminated.
Sign in to post a comment.
Posted by Microsoft on 1/10/2012 at 3:46 PM
Hello Dmitry,

Thank you very much for reporting this problem. It has been fix in next release of Visual Studio.

Lukasz Chodorski
Windows C++ Libraries Team
Posted by MS-Moderator07 [Feedback Moderator] on 12/20/2011 at 1:10 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by MS-Moderator01 on 12/20/2011 at 12:43 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)