From -2155295550634932572
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,22698cf43904ecac
X-Google-Attributes: gidf78e5,public
From: kuehl@horn.informatik.uni-konstanz.de (Dietmar Kuehl)
Subject: Re: iostream changes
Date: 1997/09/12
Message-ID: <5vc9mk$9f8$3@news.belwue.de>#1/1
X-Deja-AN: 271981972
References: <340BA7EE.500A@parawave.com> <5v6ife$64h@hermes.synopsys.com> <34173136.52AA@Eng.Sun.COM> <EGDHsv.60w@research.att.com> <341c2ac9.169360657@nntp.ix.netcom.com>
X-Original-Date: 12 Sep 1997 20:46:12 GMT
Organization: Fakult�t f�r Mathematik und Informatik
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUBNBmpoUy4NqrwXLNJAQEcgwIAt1pCvk5u40QBDW3PUee9X2ycbYaEI5MQ xsqhGJGfFAkuzjqRv5sfhZUHKqjZ9v9+WslAAURfP10MsQzjVSZp4w== =wkyJ
Reply-To: dietmar.kuehl@uni-konstanz.de
Newsgroups: comp.std.c++
Originator: austern@isolde.mti.sgi.com



Hi,
Mike Rubenstein (miker3@ix.netcom.com) wrote:
: bs@research.att.com (Bjarne Stroustrup) wrote:
: > 	#include<iostream>
: > 
: > 	int main()
: > 	{
: > 		std::cout << "Hello, world\n";
: > 	}

: the example you give.  Even there, it gives a warning and it is
: questionable whether the program produced executes as required by the
: standard (it returns a nonzero return code to the command processor
: instead of 0 which is normally used for successful execution under
: Windows NT).

Just note, that the program posted by Bjarne Stroustrup is standard
conformant *AND* returns EXIT_SUCCESS (which is defined to be 0). That
is, it is completely correct. According to the standard, that is... The
point here is the special exception for the function 'main()' saying
that floating off the end of the function 'main()' is equivalent to
exiting the function with 'return 0;'.  However, this is a special
exception holding only for 'main()'. Floating off the end of any other
function returning something different than 'void' resutls in undefined
behavior.
--
<mailto:dietmar.kuehl@uni-konstanz.de>
<http://www.informatik.uni-konstanz.de/~kuehl/>
I am a realistic optimist - that's why I appear to be slightly pessimistic
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]



