> Right, so let's do that. See 2.1.2.2 of C89 or 5.1.2.2.1 of C99:
>
> * The value of argc shall be nonnegative.
>
> * argv[argc] shall be a null pointer.
>
> * If the value of argc is greater than zero, the array members
> argv[0] through argv[argc-1] inclusive shall contain pointers to
> strings, which are given implementation-defined values by the host
> environment prior to program startup. The intent is to supply to the
> program information determined prior to program startup from
elsewhere
> in the hosted environment. [...]
>
> It is clear from the above that argc may be 0.
>
You are rigth... till now i've never found a system that pass a 0 as
argc, but it should exist,
maybe on a very small controllers environment...
>
>>>> return(-1);
>>>>
>>>>
>>> This has no ****table meaning (and the parentheses are redundantly
>>> superfluous).
>>>
>>>
>> I'm not agree, it' more readable.
>>
>
> Please explain why parentheses make the return code more readable. Does
> this apply to every expression, or just to the expression that
> (optionally) follows a return statement? If so, why is return special?
>
It's just a question of style. I prefer to place parentheses. Return is
not special, so it
is trated in the same way of all other cases where parentheses should be
used also
when they are superfluous.
> What makes you think that adding parentheses helps? If the reader can't
> comprehend a*32 / b + c - d * e / oh_my_good, why are they more likely
to
> comprehend (a*32 / b + c - d * e / oh_my_good)?
>
Yea, but of couse for me is much better to use parentheses:
retun( (((z*100)/y)+((w-r)*k)) / u );
That it is a non-ambiguous form, readable also from people with little
knowledge
of the language and not familiar with the specific operator's precedence.
b.


|