Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actuallipsryme

Posted 07 April 2013 - 12:16 PM

Assuming a function that looks kind of like this:

 

bool Test(in float x, in float3 cameraPosition)
{
  float3 l = float3(cameraPosition.x, cameraPosition.y + 10.0f, cameraPosition.z);

  if(l.x <= 0.5f)
  {
    //...
    return true;
  }
  else
  {
    //...
    return true;
  }

  return false;
}

 

This will print a warning saying: "error X4000: Use of potentially uninitialized variable" at the exact line of the if condition.

In this situation how would I avoid the warning ? I've tried several things like giving it a default value but it just doesn't work.

Any ideas ?


#4lipsryme

Posted 07 April 2013 - 12:16 PM

Assuming a function that looks kind of like this:

 

bool Test(in float x, in float3 cameraPosition)
{
  float3 l = float3(cameraPosition.x, cameraPosition.y + 10.0f, cameraPosition.z);

  if(l.x <= 0.5f)
  {
    //...
    return true;
  }
  else
  {
    //...
    return true;
  }

  return false;
}

 

This will print a warning saying: "error X4000: Use of potentially uninitialized variable". At the exact line of the if condition.

In this situation how would I avoid the warning ? I've tried several things like giving it a default value but it just doesn't work.

Any ideas ?


#3lipsryme

Posted 07 April 2013 - 12:15 PM

Assuming a function that looks kind of like this:

 

bool Test(in float x, in float3 cameraPosition)
{
  float3 l = float3(cameraPosition.x, cameraPosition.y + 10.0f, cameraPosition.z);

  if(l.x <= 0.5f)
  {
    //...
    return true;
  }
  else
  {
    //...
    return true;
  }

  return false;
}

 

This will print a warning saying: "error X4000: Use of potentially uninitialized variable".

In this situation how would I avoid the warning ? I've tried several things like giving it a default value but it just doesn't work.

Any ideas ?


#2lipsryme

Posted 07 April 2013 - 12:15 PM

Assuming a function that looks kind of like this:

 

bool Test(in float x, in float3 cameraPosition)
{
  float3 l = float3(cameraPosition.x, cameraPosition.y + 10.0f, cameraPosition.z);

  if(l.x <= 0.5f)
  {
    //...
    return true;
  }
  else
  {
    //...
    return false;
  }

  return false;
}

 

This will print a warning saying: "error X4000: Use of potentially uninitialized variable".

In this situation how would I avoid the warning ? I've tried several things like giving it a default value but it just doesn't work.

Any ideas ?


#1lipsryme

Posted 07 April 2013 - 12:15 PM

Assuming a function that looks kind of like this:

 

bool Test(in float x, in float3 cameraPosition)
{
  float3 l = float3(cameraPosition.x, cameraPosition.y + 10.0f, cameraPosition.z);

  if(l.x <= 0.5f)
  {
    //...
  }
  else
  {
    //...
  }
}

 

This will print a warning saying: "error X4000: Use of potentially uninitialized variable".

In this situation how would I avoid the warning ? I've tried several things like giving it a default value but it just doesn't work.

Any ideas ?


PARTNERS