473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

conditional jump or move depends on uninitialised value(s)

29
I am using valgrind leak memory to check my program this message appears a lot of time, the program works but why this message.
example code
Expand|Select|Wrap|Line Numbers
  1. double RandNum,pp;  
  2.     double axis=AXIS;
  3.     double wise_profit=0.20;
  4.     double mu, delta,a,b;
  5.     double sattisfic_price;
  6.   RandNum=Rand.getRandomFloat();
  7.  
  8.     if(prod_size<=prod_sold && prod_sold>0) SetPrice(GetPrice()+axis*RandNum); 
  9.     else if(prod_size>prod_sold && prod_sold>0)
  10.     {
  11.         mu=wise_profit*interestrate*satisfic_wage*numworkers;
  12.         delta=prod_size*prod_size*(1-mu/(interestrate*satisfic_wage*numworkers));
  13.         a=(-prod_size*prod_size)/(4*interestrate*satisfic_wage*numworkers);
  14.         b=prod_size;
  15.         sattisfic_price=(-b-sqrt(delta))/(2*a); <<-------- Here is the error
  16.         SetPrice(sattisfic_price);
  17.     }  
  18.  
  19.  
Jan 24 '08 #1
1 4487
The problem cannot be deduced from the given sample code. It is likely that the reported error indicates your given problem - that is, you are calling a subroutine or have placed a call to a subroutine (etc.) based on a variable of which the value you have not set.

In computing, an uninitialized variable is a variable that is declared but is not set to a definite known value before it is used. It will have some value, but not a predictable one. As such it is a programming error and a common source of bugs in software.
Feb 26 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Andrew L | last post by:
Hello all, I'm new to XML schema design, and I've got a problem which I need some help with. I have a simple type which describes a list of valid categories. I also have another type which...
13
by: santosh | last post by:
Hi, If I call free() with a uninitialised pointer, will the program state become undefined, or will free() return harmlessly? Incidentally, is there a way in Standard C to determine weather a...
43
by: dev_cool | last post by:
Hello friends, I'm a beginner in C programming. One of my friends asked me to write a program in C.The purpose of the program is print 1 to n without any conditional statement, loop or jump. ...
10
by: Lyn | last post by:
Hi, I would like to make a bound text box not visible if it is empty (not just disable it). This option is not available from the standard conditional formatting feature (at least, not that I can...
19
by: Ulrich Eckhardt | last post by:
Greetings! I was recently surprised by the compiler's warning concerning this code: struct text { char* s; size_t len; }; int main() { struct text t = {"hello world!"};
13
by: Neal Becker | last post by:
In hindsight, I am disappointed with the choice of conditional syntax. I know it's too late to change. The problem is y = some thing or other if x else something_else When scanning this my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.