Jump to content

Int not recognized as int


photo

Recommended Posts

Hello

 

I had multiple times that a int is not recognized correctly as int.

 

This code does not work, it should only describe the problem a bit better.

 

int uid = 98;
int container[];
void setIndex(int _id)
{
      	// This counts the amount of the numerics
      	// First call with 99 = 2 as index
      	// Second call with 100 = 3 as index
      	// Third call with 9 = 1 as index
      	container.append(_id, "My String");

      	// Output is: 2, 3, 1
      	log.error("The uid is %i\n", _uid);

      	// Output is: 99, 100, 9
      	log.error("The uid is %i\n", int(_uid));

      	// The real int value is used
      	// 99 as index
      	// 100 as index
      	// 9 as index
      	container.append(int(_id), "My String");
}

int getUID()
{
      	uid++;
      	return uid;
}

void init()
{
      	setIndex(getUID());
      	setIndex(getUID());
      	setIndex(9);
}

 

 

Just for curiosity what can be the source of such a thing? (I know it is a untyped language, but never had such problems in other untyped languages)

Link to comment
  • 3 months later...

Please, post or attach a working sample (this one is not), so we can figure out your problem.

Hi Manguste

 

Sorry was a busy time the last months. :)

I can still reproduce this bug in our code, but not in simple examples.

 

What I can do is to provide SSH-Access to a development server and write a short documentation who to path is and where to int change to something strange.

Is it worth a try?

 

Greets

Link to comment

Manuel,

 

Short examples are good since they make clear what causes the issue. I'm afraid having to find a needle in a haystack/the whole project is not OK for our developers. Please, try to come up with a minimal test scene. That would be helpful. Giving access to a development server (even with a doc) hardly is.

 

Thank you for understanding.

Link to comment
×
×
  • Create New...