ANSI Standards

Doug Gwyn gwyn at smoke.brl.mil
Fri Apr 5 03:43:56 AEST 1991


In article <104 at hdwr1.medar.com> jseymour at medar.com (James Seymour) writes:
>Does the ANSI standard eliminate the original K&R format (eventually)?

No.  It is flagged as an "obsolescent feature", which serves two purposes:
it encourages programmers to not use it unnecessarily, and it indicates to
future C standardization committees that X3J11 considered it appropriate
for this feature to be considered for removal in some future C standard.
However, its removal at some future date is not mandated.

>...does it look like that's the way "everybody" will be doing it in the
>future?  Btw: I've yet to see code from any source using the new
>ANSI format, other than examples in some texts.

I think most serious development of portable applications in C at present
has to accommodate compilers that support only the old style of function
declaration.  What some of us have done is to, in one way or another,
key on the __STDC__ macro to determine whether or not the prototype form
is employed, but maintain the policy of not relying on the special
behavior of prototypes (i.e. no automatic conversion of arguments, and
use solely of default-widened parameter types).

>2) Parenthesis are not required for return statements, but according to
>   the Second Edition K&R work, they are, and will remain, acceptable.
>   I *have* seen lots of code where the parens are not used.  Does this
>   seem to be the way most folks are heading?  If so, why?

Parentheses are always allowed around expressions.  There is no reason
to expect that to ever change.  Use of redundant parentheses is purely
a stylistic issue.



More information about the Comp.lang.c mailing list