------- Comment #3 from kargl at gcc dot gnu dot org  2008-01-18 01:32 -------
(In reply to comment #2)
> I have installed
> gcc version 4.3.0 20071231 (experimental) [trunk revision 131236] (GCC)
> and the error goes away. I can turn it on and off by switching between 
> the two, though it is not  conclusive that the problem has been solved 
> because it appeared  to depend in some complex way on how the program 
> was arranged, as if it was an overwriting/ buffer-overflow/memory leak 
> sort of problem. So its disappearance could be a chance of how memory is 
> allocated.

Add -Wall -fbounds-check to your command line.  Fix all warnings and
errors.

> Incidentally the new version does indeed warn about **-2.0  .  I agree 
> it is bad practice but without looking carefully at the rules I am not 
> sure that it is ungrammatical. -2.0 is after all a constant, so the 
> expression is of the form [variable] [operator] [constant]

It doesn't matter.  The ** operator has higher precedence than the 
- operator.  In fact, you have [variable][operator][operator][constant].

You should also change the 2.0 to simply 2.  Why?  Because x**-2.0 may
be to a function call of pow(x, -2.0) whereas x**2 becomes x*x.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34837

Reply via email to