The_Sage & void main()

K

Kwan Ting

"Mike Smith" wrote .)
Won't you folks all just *plonk* this loser already?

I actually did :-D Something came across my mind one day and I couldn't
resist posting something :-D
At least I did name the Subject such that people don't have to read it if
they didn't want to :)

Kwan Ting
 
G

Greg Comeau

The_Sage said:
You C++ types aren't the brightest group on the web, are you? We have been
through this already. The ISO C++ Standard also says that you can optionally
return other types, ie -- int main() is one required type but void main() is
another, optional return type. It is "implementation-defined" as the actual
standard puts it. Notice how the above article goes on to list all the C++
compilers that allow void main(), such as IBM, MS, and Borland, yet they
are all ISO compliant.

Read the link man, they are talking about C. C and C++ are not the same
thing. From your own source:

"void main() is not legal in C++ but is legal in C. "

Pay special attention to "void main() is not legal in C++"

To continue:

"The ISO C++ Standard (ISO/IEC 14882:1998) specifically requires main to
return int. But the ISO C Standard (ISO/IEC 9899:1999) actually does not. "

Of special importance to this subject is the text, "The ISO C++ Standard
... requires main to return int."

Most C compilers also compile C++. Here is the part you seem to like to
flout like it confirms your position:

"Watcom C/C++. The *C* Library Reference for Watcom's *C* compiler says
that "the main function can be declared to return void"." [emphasis added]

Note that this entire page is about a different language than C++. But
to go on:

"Some compilers do not provide this loophole"

Also note that the author of the page wishes that the *C* standard was
changed so that void main could not be allowed. It is but an error in
grammar which allows it...

"Because of the semi-colon, its final sentence parses as follows: "

Also of note:

"However, Greg Comeau was shown this web page, and in response changed
the examples to use int main()."

Which is rather interesting since this page says that according to the C
standard void main is ok in that language. Apparently the author of
this website convinced Mr. Comeau that, though it is apparently legal,
nobody should use void main(). Apparently this, and the fact that they
speak of C and explicitly state that int is the only legal return type
in C++ according to the standard, was missed by you.

Most important in this whole fiasco is that you yourself provided the
source that has proven you wrong so doubtlessly. Even if you don't
believe the standard and wish to misconstrue its meaning, you apparently
believe this website which states beyond confusion:

"void main() is not legal in C++ ..."

Your position is hopelessly lost as you have cut your own throught.
Check and mate.

I am jumping into this thread mis-stream since there is a reference
to something I did or said. I have to say that AT BEST the
legality-of-void-main.html webpage is apparently characterizing
something I did out of context, and so I can pretty much say
any reference to me is ridiculous.

Second, all references to all vendors on that URL are misleading,
since it does not say what the void main being acceptable by those
compilers means. For instance, say in non-strict C++ mode,
Comeau C/C++ accepts void main. But saying that doesn't really
say what it does in strict mode.

Third, I have to confess to not looking up the respective rules
for "void main" in some times, and I'm not going to now,
but from a quick skim of legality-of-void-main.html webpage,
I don't think I agree with it. As I recall it though,
if we're talking about "strictly conforming" then C++ and C99
requires a diagnostic, whereas C90 doesn't. As is often the case,
concluding this probably requires referring to multiple sections.
 
T

The_Sage

Reply to article by: "WW said:
Date written: Fri, 26 Sep 2003 06:57:03 +0300
MsgID:<[email protected]>
Yes, and you have been porved wrong. You are not the brightest, are you?

Hehe! Thank you for proving my point about how people like you aren't the
brightest guys on the web. Let me reiterate the part you haven't read and
therefore have yet to refute in an intelligent or factual manner...

From the ISO standard:
"3.6.1 Main function paragraph 2:
It shall have a return type of type int..."

Which all ISO compilers like MS, Borland, and IBM do.

"...but otherwise..."

See that word? It means that the standard allows breathing room for other return
types IN ADDITION TO int main().

"...its type is implementation-defined"

Therefore, any compiler that implement-defines other types of main() functions,
in addition to int main(), types like void main() for example, are ISO
compliant, hence since MS, Borland, and IBM use int main() AND ALSO
IMPLEMENT/DEFINE void main(), they are therefore also ISO compliant.

I have yet to be proved wrong -- care to give it try yourself? Stop your yapping
and let's see what you are really made of.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: Noah Roberts said:
Date written: Thu, 25 Sep 2003 22:30:16 -0700
MsgID:<[email protected]>
Read the link man, they are talking about C. C and C++ are not the same
thing. From your own source:

No, they were talking about both. Do a word search.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: "Phlip said:
Date written: 26 Sep 2003 14:56:51 GMT
MsgID:<[email protected]>

Haha! I'm glad to see that someone around here is intelligent enough to have a
sense of humor! Thanks for reminding us that there is nothing about the topic of
void main() vs int main() that is worth taking very seriously.
However, I have carefully researched this issue, for many, years, and I have
come to the conclusion that one should not use void main, and should prefer
int main, for a number of valid technical reasons.
Void main:
* causes illiteracy in lab mice
* inspires television networks to move reality shows to the next logical
step: Human sacrifice
* will transmit the contents of your internet cache folders to the nearest
repressed fundamentalist priest
* will precipitate the return of the Joe Isuzu commercials (1999/11/20)
* causes destructive thread recidivism in technical newsgroups
* will attract biker gangs to your granma's neighborhood
* is a capitalist plot
* nutates the precession of the equinoxes
* has designs on your kid sister
* makes killer bees think you smell like Chanel No. 5
* inspires white supremacists to come "out" about their thing for Reggae
music
* will inspire mass media to get over this current cheerleader thing
* denies workers control over the means of production
* relaxes the prohibitions against split infinitives (1999/04/24)
* is caused by orbiting microwave platforms that target the thermal
resonance signature of your neurons
* makes Disney executives have vivid anxiety dreams about not litigating
enough
* makes folks >still< think alien beings make crop circles
* uses NFL broadcasts without the expressed written consent of Fox Network
* will make your loved ones think you have been possessed by aliens
* will make you blind, grow hair on your palms, and convince you to vote
Republican
* increases the chances air traffic controllers accidentally cross flight
corridors directly over your house
* makes street lunatics think you are part of the conspiracy against them
* points the Hubble Space Telescope at your house
* makes IBM think they have a prayer of solving the Protein Folding Problem
in less time than the Sun takes to burn out
* makes George Lucas think we can tell the difference between any of his
StarWars movies
* makes your balls drop off
* inspires a remote tribe in Borneo to carve big wooden statues that look
just like you
* causes Phlip's big toe to swell up like a balloon
* inspires Hollywood executives to sign off on yet another insipid
live-action remake of an insipid 1970s cartoon
* has been cruely tested on charismatic dolphins and adorable baby seals
* has already caused the return of Joe Isuzu, as I prophesied on this
newsgroup last year (2001/04/04)

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
R

Randall Hyde

SomeDumbGuy said:
void main() is not legal in C++ but is legal in C.


I hope you're not expecting him to know C any better than C++.
He steadfastly claims that the following is C code (in fact, it is high-level
assembly code, but he has gone on record about a dozen times swearing
that it is a C program; we're not talking about misplaced semicolons here
folks...)

program regexp;
#include( "stdlib.hhf" )
const
MaxLines := 100;

static
f :dword;
i :uns32;
filename :string;
lineCnt :uns32;
areaCode :str.strvar(16);
prefix :str.strvar(16);
suffix :str.strvar(16);
lines :string[ MaxLines ];

begin regexp;

if( arg.c() != 2 ) then

stdout.put( "Usage: regexp <filename>" nl );
exit regexp;

endif;
mov( fileio.open( arg.v( 1 ), fileio.r ), f );
mov( 0, ebx );
while( !fileio.eof( f )) do

fileio.a_gets( f );
mov( eax, lines[ ebx*4 ] );
inc( ebx );

endwhile;
mov( ebx, lineCnt );
fileio.close( f );
for( mov( 0, i ); mov( i, edx ) < lineCnt; inc( i )) do

pat.match( lines[ edx*4 ] );

pat.zeroOrMoreCset( -{ '(','0'..'9' } );
pat.zeroOrOneChar( '(' );
pat.exactlyNCset( {'0'..'9'}, 3 );
pat.extract( areaCode );
pat.zeroOrOneChar( ')' );
pat.zeroOrMoreWS();
pat.exactlyNCset( {'0'..'9'}, 3 );
pat.extract( prefix );
pat.oneOrMoreCset( {'-', ' '} );
pat.exactlyNCset( {'0'..'9'}, 4 );
pat.extract( suffix );

stdout.put( i:2,": (", areaCode, ") ", prefix, '-', suffix, nl );

pat.if_failure;

pat.endmatch;

endfor;

end regexp;
 
N

Noah Roberts

Mike said:

"[Usenet: possibly influenced by British slang 'plonk' for cheap
booze, or 'plonker' for someone behaving stupidly (latter is lit.
equivalent to Yiddish schmuck)] "

I always thought it was representative of the sound a turd makes as it
hits the water, just before you flush it and never see it again. Were
the hell did they get the above?

NR
 
S

sinewave

if Orson Wells were alive today his "War of the Worlds" would feature
aliens landing in Silicon Valley, California. the aliens would demand the
ANSI/ISO C++ standards and then announce that the universe at large demands
void main() be used over int main(). imagine all the volvos fleeing town,
frantic calls to Bjarne, organized prayer groups in Redmond Washington,
suicides by mountain dew overdose, lines of teary eyed geeks strung out on
valium clutching their now-worthless $175 (US) copy of the standard
mumbling "my code is not compliant mommy", and last rights given en mass to
comp.lang.c++. ret
 
W

WW

The_Sage said:
Hehe! Thank you for proving my point about how people like you aren't
the brightest guys on the web.

I all I had proven is that you are as bright as a black hole.
Let me reiterate the part you haven't
read and therefore have yet to refute in an intelligent or factual
manner...

You have never applied eaither intelligence or facts in this thread. You
have lied about code compiling (which isn't due to mising semicolon) so
don't come mumbling about facts, liar.
From the ISO standard:
"3.6.1 Main function paragraph 2:
It shall have a return type of type int..."

Which all ISO compilers like MS, Borland, and IBM do.

"...but otherwise..."

See that word? It means that the standard allows breathing room for
other return types IN ADDITION TO int main().

"...its type is implementation-defined"


No it says (as one f*cking sentence):

"It shall have a return type of type int but otherwise its type is
implementation-defined."

The same written in C++:

int main(herecanbeanything);

That is what it means, brainless The Sage. A functions type consist of its
return type and the number, the order and types of its arguments. So saying
it shall have a return type of type int, means it shall have a return type
of type int. Not void. Not std::string. Not TheSage::NoBrain. It shall
have a return type of type int. OTHERWISE its type is implementation
defined MEANS that the number, the order and the type of its arguments is
implementation defined AND the f*cking paragraph CONTINUES by presenting the
TWO COMPLETE FUNCTION SIGNATURES (I just hope The Sage can read all caps
better. Children and mentally challenged do.) which ALL IMPLEMENTATIONS
MUST SUPPORT, but they CAN SUPPORT any OTHER SIGNATURES as long as the ALL
RETURN INT. That is what it means. If you don't understand it just take a
life-long vacation at a nearby mental hospital.

Therefore, any compiler that implement-defines other types of main()

Intellgient says: implement-define... Oh boy.
functions, in addition to int main(), types like void main() for
example, are ISO compliant,

It is not. As the standard sasy: main shall have a return type of type int.
Period.
hence since MS, Borland, and IBM use int main()
AND ALSO IMPLEMENT/DEFINE void main(),
they are therefore also ISO compliant.

They are, if and ONLY if they give you an error or warning message during
compilation TELLING YOU THAT VOID MAIN IS NOT STANDARD C++.
I have yet to be proved wrong

You have been proven wrong about 80 times. Now stop playing stupid and
repeating the same blabla 300 times all over again. If all you can do is
lie and lie and lie and just crowl away. Everyone here knows you are a
liar.
-- care to give it try yourself?

I don't need to. I work with 5 C++ compilers which immediately stop with
the error message: main shall have a return type of int. I use my other
compilers with flags needed to make them ISO compliant and they also wanr
about it that main must return int.
Stop
your yapping and let's see what you are really made of.

Stop your yapping and let's see what you are really made of! So as I have
asked you already many times: GET your copy of the STANDARD in your hand!
Look at chapter 28 and tell me what it says about the main function! If you
don't do this, I have to assume that you have no standard and you have
absolutely no idea what are you talking about. I am not going to reply to
you until I see you quote here what Chapter 28 of the ISO C++ standard says
about the main function. Until you do that I take you as a liar who has not
C++ compilers and does not even have the standard.
 
G

Greg Comeau

Hehe! Thank you for proving my point about how people like you aren't the
brightest guys on the web. Let me reiterate the part you haven't read and
therefore have yet to refute in an intelligent or factual manner...

From the ISO standard:
"3.6.1 Main function paragraph 2:
It shall have a return type of type int..."

Which all ISO compilers like MS, Borland, and IBM do.

"...but otherwise..."

See that word? It means that the standard allows breathing room for other return
types IN ADDITION TO int main().

"...its type is implementation-defined"

Therefore, any compiler that implement-defines other types of main() functions,
in addition to int main(), types like void main() for example, are ISO
compliant, hence since MS, Borland, and IBM use int main() AND ALSO
IMPLEMENT/DEFINE void main(), they are therefore also ISO compliant.

I have yet to be proved wrong -- care to give it try yourself? Stop your yapping
and let's see what you are really made of.

The type of a function involves a few parts.
The return type is one part, there are other parts (like the types
of the arguments as another one). What the above says in that
one part remains the same (the return type) while the other
parts may be variable.... if we're talking about strict conforming
and we're talking about a hosted environment.
 
T

The_Sage

Reply to article by: "WW said:
Date written: Sat, 27 Sep 2003 12:59:31 +0300
MsgID:<[email protected]>
No it says (as one f*cking sentence):
"It shall have a return type of type int but otherwise its type is
implementation-defined."

Uh, duh!
The same written in C++:
int main(herecanbeanything);
That is what it means, brainless The Sage.

Bwahaha! The subject is RETURN TYPE, not PARAMETERS. NO MENTION WAS MADE IN THAT
ONE F*CKING SENTENCE ABOUT PARAMETERS.

Thank you for giving me the oppotunity to irrefutably prove what a total idiot
you are.

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 
T

The_Sage

Reply to article by: Noah Roberts said:
Date written: Fri, 26 Sep 2003 19:38:54 -0700
MsgID:<[email protected]>
A word search does not work, you must *read* the site.

I see you don't know how to use a word search. Heck, even the title tells you
that they are talking about C and C++, ie -- "VOID MAIN() IS NOT LEGAL IN C++
BUT IS LEGAL IN C". Funny how you missed that. Then they listed all the C and
C++ compilers that used void main() in BOTH C and C++. In fact, if you could
learn to click on the link they gave to Microsoft, you would see where
Microsofts online documenation for their C++ compiler uses void main().

DUH!

The Sage

=============================================================
My Home Page : http://members.cox.net/the.sage

"The men that American people admire most extravagantly are
most daring liars; the men they detest the most violently are
those who try to tell them the truth" -- H. L. Mencken
=============================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,085
Latest member
cryptooseoagencies

Latest Threads

Top