This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
wrong parameter passing
- From: Muhammad Ali <Muhammad dot Ali at ebp dot de>
- To: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 9 Jul 2002 09:37:18 +0200
- Subject: wrong parameter passing
Hi All,
I am using gcc 3.1 on Irix. My project is quite big. I have this problem
that I have declared a string constant in one of the contructors of one
class to initialize a member variable. So the member varaible always gets
this values. And this string constant is unique in the whole project. I have
to make a lot of objects of this class during the execution of program
because it performs my logging realted to poject. Now it happens one out of
hundered times that at totally different point in a different class where I
am calling a function with a string parameter from another class. Instead of
the right string value this constant value is passed and my whole project
has to stop because it recognizes it as invalid value of the parameter. I
know about the wrong value passed because I can see in my log files what
were the parameters that were passed. Now I again execute the code. The code
executes fine with passing the right values for the parameters. So this is a
strange behaviour that how the string constant from a totally different
class can be used as a parameter by some totally different function of a
totally diffrent class. Because I am calling a function in class A with
parameters having known values at all of times while it recieves as
parameter a thing decalred as string constant in class B construtor. There
seems no logic in this. It seems that the CPU pointers are somehow get
disturbed during one execution out of hundered let say. I am writing a time
& mission critical application which makes my life difficult. I would be
thankful if someone can tell me if someone else has also expereienced the
same problem or any possible thing pointing towards solution.
Regards
Muhammad Ali