This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Why is this diagnostic only reported with -pedantic?



On 2005-02-10, at 17:47, Tom Schutter wrote:


On Thu, 2005-02-10 at 11:21 +0100, Andreas Schwab wrote:
Tom Schutter <tom@platte.com> writes:

In my opinion, the problem in baz() is just as bad as the problem in
foo().

Why do you think so? What can go wrong this way (apart from being less
portable)?


Andreas.

It helps to imagine that these functions are 100 lines long instead of 1
line long.


The programmer assumes that a value is being returned by foo(), because
of the return(1).  The programmer also assumes that a value is being
returned by baz(), because of the return(bar()).

void is the null value null set the nothing or zero. I think it's perfectly
logical to be able to return an entity which is empty where this is
specified. And from the pragmatical point of view - this may help automatically
generated code too.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]