RE: [sv-bc] E-mail Ballot: Respond by Wed Sep 05 8am PDT

From: Mark Hartoog <Mark.Hartoog_at_.....>
Date: Wed Sep 05 2007 - 10:11:12 PDT
The references you point to all indicate that a non-void function
is an expression operand. However, I think the sentence "Calling a
nonvoid 
function as if it has no return value can result in a warning message."
is very clear as to what the intent of the LRM was. The intent was that
at most this would produce a warning. Note that the sentence does not
even
require a warning. It just says "can result in a warning". Both C and
Java
give at most warnings for discarding the return value of a non void
function.

I think that an error was not the original intent of the LRM and that
changing
this to an error would be a backwards compatibility issue.  

> -----Original Message-----
> From: Bresticker, Shalom [mailto:shalom.bresticker@intel.com] 
> Sent: Tuesday, September 04, 2007 10:08 PM
> To: Mark Hartoog
> Cc: sv-bc@eda.org
> Subject: RE: [sv-bc] E-mail Ballot: Respond by Wed Sep 05 8am PDT
> 
> Mark, 
> 
> > SVDB 1988 ___Yes   _x__No  
> > http://www.eda.org/svdb/bug_view_page.php?bug_id=1988
> > I believe we should discuss whether this should be a warning or an 
> > error. The old text could be confusing, but seemed to 
> indicate it was 
> > a warning. This new text clearly makes it an error. I am 
> not sure that 
> > is what users want.
> 
> Reminder to everyone: the issue is:
> 
> '13.4.2 says,
> 
> "Functions that return a value must be assigned or used in an 
> expression. Calling a nonvoid function as if it has no return 
> value can result in a warning message."
> 
> The first sentence implies that it is not possible to use a 
> nonvoid function like a void function. The second implies 
> that it is possible, just may give a warning.'
> 
> I would like to point out some additional sources:
> 
> 13.2: "A nonvoid function shall return a single value". A 
> statement can not be a value.
> 
> 13.4.1: "Function calls are expressions unless of type void, 
> which are statements." An expression is not a statement.
> 
> 13.5: "A nonvoid function call is an operand within an expression."
> 
> I think all these make clear that it was not intended to 
> allow a nonvoid function call as a statement. Especially the 
> first sentence quoted from 13.4.2, which uses the word "must".
> 
> The void cast exists exactly to allow users to do that. 
> Otherwise, what is the point?
> 
> Regards,
> Shalom
> 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Fri Sep 7 15:07:45 2007

This archive was generated by hypermail 2.1.8 : Fri Sep 07 2007 - 15:08:26 PDT