Mail Archives: djgpp/1997/12/16/12:01:52
At 18:52 15/12/97 +0000, John M. Aldrich wrote:
[snipped]
I can only second you on the snipped comments, John!
>Umm, I would like to point out here that 'void' did not exist in
>pre-ANSI compilers. A K&R definition of main might look like "main()",
>or "int main()", but never "void main()". The 'void' construct was
>probably introduced by programmers who were too lazy to put a 'return'
>statement at the end of main(), and who then wrote books and taught
>courses that passed on their flawed methodology. Perhaps, at some
>point, they stressed that "void main()" is not correct, but by then it
>was too late.
>
The "void" construct was not "introduced by programmers who were too lazy to
put a 'return'" as you surmise, but instead was "created" via typedef in pre
ANSI compilers by people that would like to emphasize in their prototypes
that some procedure did not return anything and/or some functions had nor
arguments. The ANSI Standard made it have more formal uses.
[more stuff snipped]
I commented this matter in another mail.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Cesar Scarpini Rabak E-mail: csrabak AT ipt DOT br
DME/ASC Phone: 55-11-268-3522 Ext.350
IPT - Instituto de Pesquisas Tecnologicas Fax: 55-11-268-5996
Av. Prof. Almeida Prado, 532. Sao Paulo - SP 05508-901 BRAZIL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Raw text -