POV-Ray : Newsgroups : povray.off-topic : Computer language quirks : Re: Computer language quirks Server Time
30 Jul 2024 02:19:03 EDT (-0400)
  Re: Computer language quirks  
From: Darren New
Date: 13 May 2011 12:51:16
Message: <4dcd6184$1@news.povray.org>
On 5/13/2011 0:44, Zeger Knaepen wrote:
> the function "bar" doesn't return anything, so if "foo" returns the
> return-value of "bar", it also doesn't return anything.

And that's exactly why I started this thread. The syntax makes that 
distinction, whereas I thought it shouldn't. Turns out that C++ at least 
really doesn't make that decision.

Altho given that a simple "return;" from a function declared as returning an 
int in C doesn't even raise a warning in gcc, I suspect it's at least as 
much the traditional sloppiness of C in terms of parameter passing as it is 
something intentionally designed into the spec.  ("return 28;" from a void 
function gives a warning but not an error.)

-- 
Darren New, San Diego CA, USA (PST)
   "Coding without comments is like
    driving without turn signals."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.