Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: gcc failure (optimised/non-optimised) Date: Sat, 22 Apr 2017 08:35:48 -0700 Organization: None to speak of Lines: 23 Message-ID: References: <58fb2265.5246218@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="195fda90d42f331995378fd58491ae8d"; logging-data="30619"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bT2I6cR3m/AGwcK7barTT" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:iJ3XdwhmPspXh2xwic6wqW2XXYA= sha1:cCEPYHE4vm84/ikSpfiZxXYFlqQ= Xref: csiph.com comp.lang.c:108341 bartc writes: [...] > I changed the code a little to this: > > int main(void) { > int i,m; > m=0x7fffffff; > for (i = 0; i < m + 1; i++) > ; > return 0; > } [...] Assuming 32-bit int, 0x7fffffff is equal to INT_MAX. What behavior did you expect when evaluating INT_MAX + 1? (Any possible expectation is incorrect.) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"