Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 01 Dec 2011 18:29:04 -0600 Message-ID: <4ED81BD0.4855@mindspring.com> Date: Thu, 01 Dec 2011 19:29:04 -0500 From: pete Reply-To: pfiland@mindspring.com Organization: PF X-Mailer: Mozilla 3.04Gold (WinNT; I) MIME-Version: 1.0 Newsgroups: comp.lang.c Subject: Re: Type interchange References: <4ED6AE65.8050901@verizon.net> <4ED6C5F0.1080608@verizon.net> <0.041cc3761d33f47105cd.20111201030905GMT.87d3c9ouni.fsf@bsb.me.uk> <4ED7A703.4658@mindspring.com> <4ED80320.7A05@mindspring.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 43 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 4.154.222.122 X-Trace: sv3-9vsoyfhSSzmxWY+EaYH9lwGCFeDdNqtHG8fPwvWTIz6FiRQmI0aJtIC2BgkWCgKUpdMQ6QqWaocxmz5!/X7yNMyP401RnUINHyWXekqBWHgdL6C+6aLLjvu2bmj3/mc+eLdEjeebUS5uru0xIlorYKqhL5uo!ZPqWEOxNNRA= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2905 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c:14201 Keith Thompson wrote: > > pete writes: > > Keith Thompson wrote: > >> pete writes: > >> > James Kuyper wrote: > >> >> Some people prefer to describe this by saying that if there's any > >> >> possible conforming implementation > >> >> where the behavior is undefined, then > >> >> the behavior is undefined, period, even on other implementations where > >> >> the condition that makes it undefined isn't true - but I find that > >> >> interpretation incoherent. > >> > > >> > That way, > >> > whether or not a program contains undefined behavior > >> > is a property of the C program, > >> > and not a property of the > >> > combination of the implementation and C program. > >> > >> int n = 32767; > >> n ++; > > > > The behavior of that code isn't limited by the standard, is it? > > If INT_MAX == 32767, then its behavior is undefined. Otherwise, its > behavior is well defined (it sets n to 32768). > > The point is that whether or not a program contains undefined > behavior already is "a property of the combination of the > implementation and C program". Whether or not a program is a "strictly conforming program" is not dependant on the implementation, and whether or not a program is a correct program is not dependant on the implementation. The code that you posted was intended to have a portability issue. A non portable program construct for which the standard imposes no requirements, is what the standard says yields undefined behavior. -- pete