Re: C question: typecast changes behavior with optimizations enabled.

2006-09-26 Thread Ian Lance Taylor
Adam Dickmeiss <[EMAIL PROTECTED]> writes: > Consider the attached which sweeps through an array of chars.. > > 1) If a typecast is used (CAST defined), the *src is not updated and > main will see (sz == 0). > > 2) If no typecast is used, *src is updated, and size == 1. 1) Wrong mailing list.

C question: typecast changes behavior with optimizations enabled.

2006-09-26 Thread Adam Dickmeiss
Consider the attached which sweeps through an array of chars.. 1) If a typecast is used (CAST defined), the *src is not updated and main will see (sz == 0). 2) If no typecast is used, *src is updated, and size == 1. I expected that *src would be updated in both cases (hence the assert).. But