Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <02b701c0b707$7c30a230$3c5350d8@bluesguitar.org> From: "Matthew Smith" To: "Cygwin" References: Subject: Re: Debugging setup.exe Date: Tue, 27 Mar 2001 15:47:14 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Changing 'int r' to 'volatile int r' seemed like a good idea, so I tried that, and it works well. Now however, I've run into some stranger behavior still. Take a look at this code snippet: r = (y + ROW_MARGIN/2) / row_height; if (r < 0 || r >= npackages) return 0; int p = package_indexes[r]; if (x >= headers[NEW_COL].x - HMARGIN/2 && x <= headers[NEW_COL+1].x - HMARGIN/2) { ... Ok, I step through and 'r' is set to a reasonable number. 'p' is then set to 0, which seems reasonable enough as well. We hit the 'if' conditional, and get this....execution then goes BACKWARDS and executes the 'int p = package_indexes[r];' line again! At that point, p is set to some gigantic negative number, so when we use it as an array index a short time later, everything blows up. Is this related to the optimizer too? Seems odd. cheers, -Matt Smith > looks like it's optimized away, > so try 'volatile int r'! > > Bye, Heribert (heribert_dahms AT icon-gmbh DOT de) > -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple