From 8482658752788903798
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,e415fe23f06d57ab
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-04-23 13:11:02 PST
Path: newsfeed.google.com!newsfeed.stanford.edu!skynet.be!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: Christopher Eltschka <celtschk@dollywood.itp.tuwien.ac.at>
Newsgroups: comp.std.c++
Subject: Re: Suggest rewording
Date: Mon, 23 Apr 2001 20:10:19 GMT
Organization: Vienna University of Technology, Austria
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <3AE414A9.B15B5883@dollywood.itp.tuwien.ac.at>
References: <003901c0ca95$562b73c0$9e00000a@yaroslav.nevacom.spb.ru>
X-Trace: mail2news.demon.co.uk 988056623 mail2news:11610 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Accept-Language: en
Lines: 52
Xref: newsfeed.google.com comp.std.c++:4203

Yaroslav Mironov wrote:
> 
> Hi,
> 
> 3.6.1/2
> ...An implementation shall not predefine the main function. This function
> shall not be overloaded. It shall have a return type of type int, but
> otherwise its type is implementation-defined...
> 
> I know that from the point of view of native english speakers the last
> sentence unambiguously means "the return type is int, everything else about
> the type of main is implementation-defined" (I hope I'm not mistaken here
> :)).
> 
> But to foreigners it is sometimes very hard to distinguish this "otherwise"
> from the "otherwise" like in "the return type is int, otherwise I'll eat my
> beard" and they spend too much time in flame wars trying to prove that the
> standard says "the return type is int, but it can also be
> implementation-defined".
> 
> Since it is an international standard I suggest rewording this sentence. It
> seems to me that something like
> 
> "An implementation shall not predefine the main function. This function
> shall not be overloaded. It shall have a return type of type int, but the
> number and type of (its) parameters are implementation-defined".
> 
> would mean the same, but in a much clearer way.
> 
> Comments?

What about just reversing the two sentences, without too much
reformulation?

"An implementation shall not predefine the main function. This function
shall not be overloaded. Its type is implementation defined, except
that it shall have a return type of int."

This has the advantage that it's less likely to change the semanics
in a non-obvious way (f.ex., the original - and my - version explicitly
allows main to be extern "C", because linkage is part of hte type.
OTOH, with your version, I'm not sure if main would still be allowed
to be extern "C" - at least it doesn't give explicit permission).

And I think the formulation with "except" is totally unambiguous.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]



