On Saturday 15 December 2007 06:17, Chas. Owens wrote:
>
> On Dec 15, 2007 2:50 AM, John W. Krahn <[EMAIL PROTECTED]> wrote:
>
> > > $ cat test.c
> > > #include <stdio.h>
> > >
> > > main () {
> >
> > In C the main function returns an int so that is not compliant with
> > the C standard[3].  It should be:
> >
> > int main ( void ) {
> >
> > >     printf("hello world");
>
> snip
>
> That depends on the version of C you are using.  Given the lack of
> other syntax in this short program I cannot tell if it is K&R C, ANSI
> C, or C99.  If he is using K&R C, that is a perfectly fine main
> definition (int return type is assumed for functions that don't
> specify).

I *DARE* you ... no, wait ... I DOUBLE DAWG DARE YOU to post that 
opinion on comp.lang.c and/or comp.programming.  Go on, I'll wait.   :-)


> The whole putting a void in the argument list thing came
> from C++; it is still perfectly valid (from K&R to C99) to define
> your main like this
>
> int main () {
>
> snip
>
> > I think that anyone with an idea in their head can make a case for
> > any absurd notion but that does not make it right or standards
> > compliant.
>
> snip
>
> I agree with this whole heartedly.  All versions of C are loaded
> guns. Anyone can pick one up, but that doesn't mean I want to stand
> next to that person.  But I think Jeff's main point was, since it is
> possible, how should we handle it?

Why don't we all just ignore standards, join the Microsoft Borg and do 
anything we want?  (Vote for Ron Paul!!!!)  Since anything is possible 
why don't we just ignore anything the program has to say?  How do we 
even know that the "data" it spews out is valid?

;-)


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to