From 5319234030449991862
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,a7bb6560624ae2c1
X-Google-Attributes: gidf78e5,public
From: James.Kanze@dresdner-bank.com
Subject: Re: More M$ Not Conforming points...
Date: 1999/08/25
Message-ID: <7q0q07$op0$1@nnrp1.deja.com>#1/1
X-Deja-AN: 517134803
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <7ps1sg$dev$1@nnrp1.deja.com> <7pu4es$1mv3$1@news.hal-pc.org>
X-Original-Date: Wed, 25 Aug 1999 13:10:40 GMT
X-Http-User-Agent: Mozilla/4.06 [de] (WinNT; I)
X-Complaints-To: news@news.unimelb.edu.au
X-Http-Proxy: 1.0 x27.deja.com:80 (Squid/1.1.22) for client 193.194.7.84
X-Trace: izvestia.its.unimelb.edu.au 935608131 3203 128.250.29.17 (25 Aug 1999 19:08:51 GMT)
Organization: Deja.com - Share what you know. Learn what you don't.
X-Article-Creation-Date: Wed Aug 25 13:10:40 1999 GMT
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN8Q/HeEDnX0m9pzZAQFDXQF9H+tccmkn9yBe5f031qLlyfsPwJ5Lyrrz BLjRaxAofDiPaXejs2xTeYa1cvLx1Pz3 =X3ZH
X-MyDeja-Info: XMYDJUIDkanze
NNTP-Posting-Date: 25 Aug 1999 19:08:51 GMT
Newsgroups: comp.std.c++

In article <7pu4es$1mv3$1@news.hal-pc.org>,
  "Greg Brewer" <nospam.gregb@hal-pc.org> wrote:
> <whbloodworth@my-deja.com> wrote in message

> > Also, M$ will warn the developer if he/she does not return a value
> > from main...which I can live with despite the fact that the C++
> > standard also states that main implicitly returns 0 if not
> > specified.  The problem is with their warning.  Given the following:

> > int main (void) { }
> > VC++ produces the following warning:
> > warning C4508: 'main' : function should return a value; 'void'
return
> > type assumed

> > "void return type assumed" ???? What ? void assumed?

> This warning is no different than any other function without a
> return. I think you will find that if you change it to
>    void main(void) {}
> it will compile without any complaints.

Which it shouldn't, supposing conforming C++, since void main is
illegal:-).

Seriously, I wouldn't change it to void main unless my code was so
riddled with Microsoft'isms that there was no chance of it ever running
elsewhere anyway.  It's a warning, not an error ; if suppressing it is
an issue (and I agree it should be), then IMHO piping the output of the
compiler through sed is the easiest and the best way.  It is, at any
case, the solution I've always used.  (Yes, including with VC++.)

--
James Kanze                   mailto: James.Kanze@dresdner-bank.com
Conseils en informatique orient�e objet/
                  Beratung in objekt orientierter Datenverarbeitung
Ziegelh�ttenweg 17a, 60598 Frankfurt, Germany Tel. +49(069)63198627


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
---
[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]



