From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,ad0e069bd33e31b6 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-12-11 11:03:13 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!nntp-relay.ihug.net!ihug.co.nz!news.compaq.com!news.cpqcorp.net!53ab2750!not-for-mail From: "Ed Vogel" Newsgroups: comp.unix.tru64 References: <2de13807.0312071026.3e7bf983@posting.google.com> Subject: Re: 5.1b CC Compiler Optimization - Structure passed to function losing values X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: Date: Thu, 11 Dec 2003 19:03:11 GMT NNTP-Posting-Host: 16.28.0.95 X-Complaints-To: abuse@HP.com X-Trace: news.cpqcorp.net 1071169391 16.28.0.95 (Thu, 11 Dec 2003 11:03:11 PST) NNTP-Posting-Date: Thu, 11 Dec 2003 11:03:11 PST Organization: Hewlett-Packard Company Xref: archiver1.google.com comp.unix.tru64:11029 "John" wrote in message news:2de13807.0312071026.3e7bf983@posting.google.com... > I have two problems / questions, firstly why is the compiler choosing > to inline the function given the error message that it reports? Because the inlining is chosen before the uninitialized condition is detected. There is no way to "unmake" the decision. Also, the diagnostic is not an error, just a warning letting the user know that some uninitialized variable has been fetched. In this case it seems a compiler bug is causing the storage to become uninitialized. > Secondly how can I restructure the code to prevent this error? Probably the easiest way is to add the -inline none switch. This will prevent inlinning which seems to be the cause of the problem. This compiler bug sounds somewhat familiar. I believe we have corrected it, but I'm not certain if the fix has been released yet. As your example did not provide a complete reproducer, I can not be sure. I would suggest you download the latest C compiler. A link can be found at the DTK web site: http://h30097.www3.hp.com/dtk/ If this compiler does not correct the problem, it should be reported via formal support channels. Ed Vogel HP C Engineering.