This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Unneccessary warning: argument ... might be clobbered by 'longjmp' or 'vfork'


Hi,

I have basicly the following code:

int MinimumBalance(/* ... */
                   double lambdaBound,
                   /* ... */)
{
   /* ... */
   if ((rc = setjmp(place)) != 0) {
      BalanceCleanup();
      return rc;
   }
   /* ... */
}

Now I get the following warning:

warning: argument 'lambdaBound' might be clobbered by 'longjmp' or 'vfork'.

This might be true, but when the jongjmp is performed lambdaBound is not used 
anymore. Only BalanceCleanup() is called and a value is returned. Why is GCC 
still complaining with this message?  How to get rid of this, without making 
lambdaBound volatile?

In my opinion GCC should be able to detect that lambdaBound is not used after 
a jongjmp and that a clobbered value does no harm.

Christoph Bartoschek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]