[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A very strange problem in C code.
- From: Bulat Ziganshin <bulat.ziganshin@...>
- Date: Thu, 6 May 2010 23:14:53 +0400
Hello Aurora,
Thursday, May 6, 2010, 8:56:49 PM, you wrote:
try to disable compiler optimizations
> Dear,
> there is a strange problem in my C code, as below:
> program:
> printf("---%p\n", soap->header);
> soap_header(soap);
> printf("---%p\n", soap->header);
> soap_header function:
> void soap_header(struct soap *soap)
> {
> printf("soap_header enter %p\n", soap->header);
> if(!soap->header)
> {
> printf("soap_header in IF %p\n", soap->header);
> if((soap->header = (struct
> SOAP_ENV__Header*)soap_malloc(soap,
> sizeof(struct SOAP_ENV__Header))))
> soap_default_SOAP_ENV__Header(soap, soap->header);
> }
> printf("soap_header exit %p\n", soap->header);
> }
> The output is :
> ---(nil)
> soap_header enter (nil)
> soap_header in IF (nil)
> soap_header exit 0xa0d3f80
> ---(nil)
> Who know the reason ? thanks.
--
Best regards,
Bulat mailto:Bulat.Ziganshin@gmail.com