<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Possible False Positive? in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745621#M2012</link>
    <description>Hi Krishna,&lt;BR /&gt;&lt;BR /&gt;_frontWingDegrees is declared as float. The only difference I can see in the code is that bank_balance_str is a char array rather than a string. I've heard that there are some memory problems with strings in VS 2010 (non-SP1) that are fixed in SP1. I am using VS 2010(non-SP1) at the moment. &lt;BR /&gt;&lt;BR /&gt;Perhaps that is the problem. I also get similar problems reported when I'm putting a float into a file stream (with my log files). Perhaps it is converting using a atof too?&lt;BR /&gt;&lt;BR /&gt;Are you using VS 2010 to test? It may be that VS 2010 is at fault here?&lt;BR /&gt;&lt;BR /&gt;All the best,&lt;BR /&gt;Ash&lt;BR /&gt;</description>
    <pubDate>Fri, 31 Dec 2010 12:53:56 GMT</pubDate>
    <dc:creator>Ash_McConnell</dc:creator>
    <dc:date>2010-12-31T12:53:56Z</dc:date>
    <item>
      <title>Possible False Positive?</title>
      <link>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745615#M2006</link>
      <description>Hi Folks,&lt;BR /&gt;&lt;BR /&gt;I can't see why I am getting this error.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[cpp]void AeroDynamics::setWingsFromParams()
    {
        
        
        ComponentPropertyPtr fw = _aeroParams-&amp;gt;prop("FrontWingAngle");
        ComponentPropertyPtr rw = _aeroParams-&amp;gt;prop("RearWingAngle");

        _frontWingDegrees = fw-&amp;gt;valueFloat();
        _rearWingDegrees = rw-&amp;gt;valueFloat();

        _frontWingAeroCoeff-&amp;gt;setPrimaryAngleDegrees(_frontWingDegrees);
        _frontWingAeroCoeff-&amp;gt;setSecondaryAngleDegrees(_rearWingDegrees);
        _rearWingAeroCoeff-&amp;gt;setPrimaryAngleDegrees(_rearWingDegrees);
        _dragAeroCoeff-&amp;gt;setPrimaryAngleDegrees(_frontWingDegrees);
        _dragAeroCoeff-&amp;gt;setSecondaryAngleDegrees(_rearWingDegrees);
    }[/cpp]&lt;/PRE&gt; I am getting a "Uninitialized partial memory access" error on line 8. When I trace the fw variable contains properly initialized variables.&lt;BR /&gt;&lt;BR /&gt;aeroParams is a CarComponent variable: -&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[cpp]class ComponentProperty{
	public:
		string name;
		string valueString;
		bool dynamic;
		string defaultValue;
		float min,max;
		float valueFloat(){
			float res = atof(valueString.c_str());
			return res;
		}
		int valueInt(){
			return atoi(valueString.c_str());
		}

		float valuePercent(){
			return 100.0f * (valueFloat() - min) / (max-min);
		}

		void setValuePercent(float percent){
			float ratio = MathUtil::limit(percent,0.0f,100.0f) / 100.0f;

			float val = (ratio * (max - min)) +min;
			valueString = STR(val);
		}

		ComponentProperty(){
			name = "";
			valueString = "";
			dynamic = false;
			defaultValue = "";
			min = -;
			max = 0;
		}
	};

	typedef std::shared_ptr&lt;COMPONENTPROPERTY&gt; ComponentPropertyPtr;
	typedef std::map&lt;STRING&gt; ComponentPropertyList;
	typedef std::shared_ptr&lt;COMPONENTPROPERTYLIST&gt; ComponentPropertyListPtr;

	class CarComponent{
	public:
		CarComponent(){
			ownedByPlayer = false;
			price = 0;
			componentId = carId = type = name = filename = description = picture = "";
		}		&lt;BR /&gt; string componentId;
		string carId;
		string type;
		string name;
		string filename;
		bool ownedByPlayer; // Only used when transferring to menus, don't trust otherwise
		int price; // In credits
		ComponentPropertyList propertyList;
		string description;
		string picture;
		SPTR&lt;COMPONENTPROPERTY&gt; prop(const string &amp;amp;propName){
			auto res = propertyList.find(propName);
			if (res == propertyList.end()){
				throw "Property Not Found";
			}else{
				return res-&amp;gt;second;
			}
		}

	private:
		
	};

	typedef std::shared_ptr&lt;CARCOMPONENT&gt; CarComponentPtr;
	typedef std::vector&lt;CARCOMPONENTPTR&gt; CarComponentList;
	typedef std::shared_ptr&lt;CARCOMPONENTLIST&gt; CarComponentListPtr;[/cpp]&lt;/CARCOMPONENTLIST&gt;&lt;/CARCOMPONENTPTR&gt;&lt;/CARCOMPONENT&gt;&lt;/COMPONENTPROPERTY&gt;&lt;/COMPONENTPROPERTYLIST&gt;&lt;/STRING&gt;&lt;/COMPONENTPROPERTY&gt;&lt;/PRE&gt; &lt;BR /&gt;I do think that both the CarComponent and the ComponentProperty are correctly. Any idea what the problem could be?&lt;BR /&gt;&lt;BR /&gt;Thanks for your help&lt;BR /&gt;All the best,&lt;BR /&gt;Ash</description>
      <pubDate>Wed, 22 Dec 2010 16:57:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745615#M2006</guid>
      <dc:creator>Ash_McConnell</dc:creator>
      <dc:date>2010-12-22T16:57:40Z</dc:date>
    </item>
    <item>
      <title>Possible False Positive?</title>
      <link>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745616#M2007</link>
      <description>Actually from the stack trace it is complaining about _threadhandle (line 8 above is aerodynamics.cpp:154)&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[plain]MSVCR100.dll!_threadhandle - :0x000230b0
MSVCR100.dll!swab - :0x0002328e
MSVCR100.dll!swab - :0x00023357
MSVCR100.dll!swab - :0x00023386
Orc.exe!setWingsFromParams - aerodynamics.cpp:154
Orc.exe!AeroDynamics - aerodynamics.cpp:67
Orc.exe!initDefaults - vehicle.cpp:483
Orc.exe!Vehicle - vehicle.cpp:165
Orc.exe!initCarPhysics - mastercarobject.cpp:146
Orc.exe!init - mastercarobject.cpp:92
Orc.exe!loadCar - cardatamanager.cpp:199
Orc.exe!switchPlayerCar - gameeventhandler.cpp:1753
Orc.exe!initRace - gameeventhandler.cpp:1784[/plain]&lt;/PRE&gt; &lt;BR /&gt;&lt;BR /&gt;Any idea what the problem could be?</description>
      <pubDate>Wed, 22 Dec 2010 17:08:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745616#M2007</guid>
      <dc:creator>Ash_McConnell</dc:creator>
      <dc:date>2010-12-22T17:08:53Z</dc:date>
    </item>
    <item>
      <title>Possible False Positive?</title>
      <link>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745617#M2008</link>
      <description>The message about "partial" typically means size difference. It looks like the right hand side of line 8 is a float. if the left hand side is a double - that might be why Intel Parallel Inspector might be reporting a diagnostic. The recipient is larger than what is being provided.</description>
      <pubDate>Thu, 23 Dec 2010 00:10:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745617#M2008</guid>
      <dc:creator>David_M_Intel3</dc:creator>
      <dc:date>2010-12-23T00:10:56Z</dc:date>
    </item>
    <item>
      <title>Possible False Positive?</title>
      <link>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745618#M2009</link>
      <description>Hi David,&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply. Both sides are floats in this case. Any other reasons as to why there would be a problem?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;Ash</description>
      <pubDate>Thu, 23 Dec 2010 07:44:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745618#M2009</guid>
      <dc:creator>Ash_McConnell</dc:creator>
      <dc:date>2010-12-23T07:44:57Z</dc:date>
    </item>
    <item>
      <title>Possible False Positive?</title>
      <link>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745619#M2010</link>
      <description>Hi David,&lt;BR /&gt;&lt;BR /&gt;Thanks for the tip, I tracked it down to the atof. I switched the functionality so that when the value is set the atof is done then rather than in the valueFloat. This has reduced the amount of errors reported greatly. &lt;BR /&gt;&lt;BR /&gt;I do think this is a bug, conversions like this shouldn't be marked as an error IMO, especially as it's explicitly cast.&lt;BR /&gt;&lt;BR /&gt;Thanks again!&lt;BR /&gt;All the best,&lt;BR /&gt;Ash</description>
      <pubDate>Thu, 23 Dec 2010 09:20:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745619#M2010</guid>
      <dc:creator>Ash_McConnell</dc:creator>
      <dc:date>2010-12-23T09:20:31Z</dc:date>
    </item>
    <item>
      <title>Possible False Positive?</title>
      <link>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745620#M2011</link>
      <description>Hello Ash,&lt;BR /&gt;
 I did some tests here to reproduce the issue here. Below is what I am doing.&lt;BR /&gt;&lt;BR /&gt;(Note: I have ensured that the function "atof" is getting called in the below code.)&lt;BR /&gt;
&lt;BR /&gt;
char bank_balance_str[20];&lt;BR /&gt;
scanf("%s", bank_balance_str); //reading a floating point value from the user&lt;BR /&gt;
 &lt;BR /&gt;
float bank_balance_float = atof((const char*)bank_balance_str);&lt;BR /&gt;
double bank_balance_double = bank_balance_float;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Please let me know if your code is doing something different from the above.&lt;BR /&gt;
&lt;BR /&gt;
Inspector XE did not report any problems although the C++ compiler 
warned about possible loss of data when assigning a double (atof returns
 a double) to a float type variable. Could you please send me some code 
snippets that I can try here?&lt;BR /&gt;
&lt;BR /&gt;
Also, can you please tell me the datatype of the variable "_frontWingDegrees" in your code? &lt;BR /&gt;
&lt;BR /&gt;
We greatly appreciate you being very active in the forum.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Krishna</description>
      <pubDate>Thu, 30 Dec 2010 22:01:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745620#M2011</guid>
      <dc:creator>Krishna_R_Intel</dc:creator>
      <dc:date>2010-12-30T22:01:08Z</dc:date>
    </item>
    <item>
      <title>Possible False Positive?</title>
      <link>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745621#M2012</link>
      <description>Hi Krishna,&lt;BR /&gt;&lt;BR /&gt;_frontWingDegrees is declared as float. The only difference I can see in the code is that bank_balance_str is a char array rather than a string. I've heard that there are some memory problems with strings in VS 2010 (non-SP1) that are fixed in SP1. I am using VS 2010(non-SP1) at the moment. &lt;BR /&gt;&lt;BR /&gt;Perhaps that is the problem. I also get similar problems reported when I'm putting a float into a file stream (with my log files). Perhaps it is converting using a atof too?&lt;BR /&gt;&lt;BR /&gt;Are you using VS 2010 to test? It may be that VS 2010 is at fault here?&lt;BR /&gt;&lt;BR /&gt;All the best,&lt;BR /&gt;Ash&lt;BR /&gt;</description>
      <pubDate>Fri, 31 Dec 2010 12:53:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745621#M2012</guid>
      <dc:creator>Ash_McConnell</dc:creator>
      <dc:date>2010-12-31T12:53:56Z</dc:date>
    </item>
    <item>
      <title>Possible False Positive?</title>
      <link>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745622#M2013</link>
      <description>Yes. I am using VS 2010 but can't see how that could be a problem. I will try using string now and see what happens. Thanks for the above note, Ash. &lt;BR /&gt;&lt;BR /&gt;--krishna</description>
      <pubDate>Mon, 03 Jan 2011 23:07:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Possible-False-Positive/m-p/745622#M2013</guid>
      <dc:creator>Krishna_R_Intel</dc:creator>
      <dc:date>2011-01-03T23:07:09Z</dc:date>
    </item>
  </channel>
</rss>

