www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - main

reply "John C" <johnch_atms hotmail.com> writes:
Is "void main()" legal now? It used to cause an access violation (on Win32), 
but now appears to be allowed. Is it? 
Feb 22 2006
next sibling parent Sean Kelly <sean f4.ca> writes:
John C wrote:
 Is "void main()" legal now? It used to cause an access violation (on Win32), 
 but now appears to be allowed. Is it? 
Yes. Sean
Feb 22 2006
prev sibling next sibling parent =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
John C wrote:

 Is "void main()" legal now? It used to cause an access violation (on Win32), 
 but now appears to be allowed. Is it? 
It should be, Walter said it was fixed in DMD 0.147 http://www.digitalmars.com/d/changelog.html#new0147: --anders
Feb 22 2006
prev sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"John C" <johnch_atms hotmail.com> wrote in message 
news:dthu9g$28gc$1 digitaldaemon.com...
 Is "void main()" legal now? It used to cause an access violation (on 
 Win32),
It did? I've been using void main() for ages on Windows..
Feb 22 2006
parent reply "John C" <johnch_atms hotmail.com> writes:
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message 
news:dtj0de$i60$1 digitaldaemon.com...
 "John C" <johnch_atms hotmail.com> wrote in message 
 news:dthu9g$28gc$1 digitaldaemon.com...
 Is "void main()" legal now? It used to cause an access violation (on 
 Win32),
It did? I've been using void main() for ages on Windows..
Maybe my memory's going.
Feb 22 2006
parent reply Derek Parnell <derek psych.ward> writes:
On Thu, 23 Feb 2006 01:24:52 -0000, John C wrote:

 "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message 
 news:dtj0de$i60$1 digitaldaemon.com...
 "John C" <johnch_atms hotmail.com> wrote in message 
 news:dthu9g$28gc$1 digitaldaemon.com...
 Is "void main()" legal now? It used to cause an access violation (on 
 Win32),
It did? I've been using void main() for ages on Windows..
Maybe my memory's going.
I think the change for 'void main(){}' is that DMD now ensures that zero is returned to the operating system. So now its the same as 'int main() {return 0;}' -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocracy!" 23/02/2006 3:18:08 PM
Feb 22 2006
parent reply Georg Wrede <georg.wrede nospam.org> writes:
Derek Parnell wrote:
 On Thu, 23 Feb 2006 01:24:52 -0000, John C wrote:
 
 
 "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message 
 news:dtj0de$i60$1 digitaldaemon.com...
 
 "John C" <johnch_atms hotmail.com> wrote in message 
 news:dthu9g$28gc$1 digitaldaemon.com...
 
 Is "void main()" legal now? It used to cause an access
 violation (on Win32),
It did? I've been using void main() for ages on Windows..
Maybe my memory's going.
I think the change for 'void main(){}' is that DMD now ensures that zero is returned to the operating system. So now its the same as 'int main() {return 0;}'
Yes. And I too don't remember when this was fixed. Probably like 6 months ago.
Feb 23 2006
parent Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
Georg Wrede wrote:
 Derek Parnell wrote:
 I think the change for 'void main(){}' is that DMD now ensures that
 zero is returned to the operating system. So now its the same as 'int
 main() {return 0;}'
Yes. And I too don't remember when this was fixed. Probably like 6 months ago.
Actually, in DMD 0.146 - two weeks back. <g>
Feb 23 2006