Andreas Schwab wrote:
> James Dennett writes:
>
>> This appears to be a difference between C and C++. Unfortunate.
>> 6.6.3 [stmt.return]/2 of N2800 says "Flowing off the end of a function
>> is equivalent to a return with no value; this results in undefined
>> behavior in a value-returning func
James Dennett writes:
> This appears to be a difference between C and C++. Unfortunate.
> 6.6.3 [stmt.return]/2 of N2800 says "Flowing off the end of a function
> is equivalent to a return with no value; this results in undefined
> behavior in a value-returning function."
Since it's merely unde
On Thu, Mar 12, 2009 at 11:29 PM, Dave Korn
wrote:
> James Dennett wrote:
>> On Thu, Mar 12, 2009 at 4:56 PM, Robert Dewar wrote:
>>> Nathan Ridge wrote:
>>>
Why does gcc not give an error about this?
If I compile with "-Wall", it will give a WARNING saying
"control reaches end of
James Dennett wrote:
> On Thu, Mar 12, 2009 at 4:56 PM, Robert Dewar wrote:
>> Nathan Ridge wrote:
>>
>>> Why does gcc not give an error about this?
>>> If I compile with "-Wall", it will give a WARNING saying
>>> "control reaches end of non-void function".
>>> However, shouldn't it be an ERROR t
> On Thu, Mar 12, 2009 at 4:56 PM, Robert Dewar wrote:
>> Nathan Ridge wrote:
>>
>>> Why does gcc not give an error about this?
>>> If I compile with "-Wall", it will give a WARNING saying
>>> "control reaches end of non-void function".
>>> However, shouldn't it be an ERROR to return nothing
>>> f
On Thu, Mar 12, 2009 at 4:56 PM, Robert Dewar wrote:
> Nathan Ridge wrote:
>
>> Why does gcc not give an error about this?
>> If I compile with "-Wall", it will give a WARNING saying
>> "control reaches end of non-void function".
>> However, shouldn't it be an ERROR to return nothing
>> from a fu
Nathan Ridge wrote:
Why does gcc not give an error about this?
If I compile with "-Wall", it will give a WARNING saying
"control reaches end of non-void function".
However, shouldn't it be an ERROR to return nothing
from a function that's supposed to return something?
Does this not result in
(Note that this is really a question for gcc-help.)
On Thu, 2009-03-12 at 23:42 +, Nathan Ridge wrote:
> Why does gcc not give an error about this?
> If I compile with "-Wall", it will give a WARNING saying
> "control reaches end of non-void function".
You can turn this warning into an error