cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: longjump warning

From: Gisle Vanem <giva_at_bgnett.no>
Date: Fri, 8 Oct 2004 17:52:25 +0200

"Andy Cedilnik" wrote:

> Building object file hostip.o...
> /home/kitware/Dashboards/My Tests/CMake/Source/CTest/Curl/hostip.c: In
> function `Curl_resolv':
> /home/kitware/Dashboards/My Tests/CMake/Source/CTest/Curl/hostip.c:382:
> warning: variable `rc' might be clobbered by `longjmp' or `vfork'

The warning stems from the assumption that 'rc' can be kept in a register
and that the register is globbered after a longjmp().
 
> The problem is in the code:
>
> /* default to failure */
> int rc = CURLRESOLV_ERROR;
> *entry = NULL;

How about?
  volatile int rc = CURLRESOLV_ERROR;

That should shut up gcc and produce safe code.

--gv
Received on 2004-10-08