[Issue 6423] Garbage is returned from `void main()`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 27 10:32:43 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=6423


Iain Buclaw <ibuclaw at ubuntu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw at ubuntu.com


--- Comment #4 from Iain Buclaw <ibuclaw at ubuntu.com> 2013-08-27 10:32:41 PDT ---
(In reply to comment #2)
> (In reply to comment #1)
> 
> > I'm guessing perhaps the compiler got confused by returning a void function?
> > I'm not sure code like this should be allowed, as it doesn't really make sense
> > to be able to return void (via a return statement) -- nothing is being
> > returned.
> 
> Returning the result of a void function from a void function is accepted by
> design.

Aye, but 'void main' is implicitly 'int main' - which is a special case in this
instance. ;-)

All other types of void returns are ok to return garbage.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list