The_Sage & void main()

T

The_Sage

Reply to article by: Noah Roberts said:
Date written: Thu, 25 Sep 2003 19:08:01 -0700
MsgID:<[email protected]>

Have you read this link? Here is a nice little quote for yah (from the
above :p):
"The ISO C++ Standard (ISO/IEC 14882:1998) specifically requires main to
return int."

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.

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
=============================================================
 
W

WW

The_Sage said:
http://homepages.tesco.net/~J.deBoynePollard/FGA/legality-of-void-main.html


You C++ types aren't the brightest group on the web, are you? We have
been through this already.

Yes, and you have been porved wrong. You are not the brightest, are you?
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.

No. It says main *must* have the int return type.
It is
"implementation-defined" as the actual standard puts it.

No. It is not. Neither the return type, nor the arguments taken are
implementation define by the standard.
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.

And yet, a C++ program code with void main in it is not ISO compliant.

You *are* boring now. Your resource are limited to lies, cutting out
relevant parts of the original message, name calling, listing some compiler
vendors who all disagree with you anyway - and some personal insults for the
end. It is all very predictable, and all boring.
 
M

Mike Wahler

The_Sage said:
l


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.

Please cite 'chapter and verse' from ISO/IEC 14882:1998
that states this.
It is "implementation-defined" as the actual
standard puts it.

Chapter and verse please.
Notice how the above article goes on to list all the C++
compilers that allow void main(),

in C programs. Even if they allow it in C++ programs,
that proves nothing. Compilers do not define the language.
such as IBM, MS, and Borland, yet they are all
ISO compliant.

None of those are completely compliant with the C++ standard,
nor do they claim such.

-Mike
 
M

Mike Wahler

WW said:
I missed that part.

Come on now, make sure your knife is sharp before
engaging the enemy. :)
I looked at the list of links, none of which has
anything to do with the langauge definition... and dismissed it as
irrelevant. But as I looked at it better... it is quote the opposite than
The Troll whished for.

I've found that this is often the case with trolls.


-Mike
 
A

Attila Feher

Mike said:
Come on now, make sure your knife is sharp before
engaging the enemy. :)

Enemy? An enemy is someone to respect and someone worthy. The Sage is a
boring annoyment. First I thought he might be able to come up with new,
entertaining ways of making a fool of himself, but he is just repeating an
old, boring, broken record.
I've found that this is often the case with trolls.

I suspect there is a pattern with trolls. They have a huge public and
protected interface. (Flooding with junk and protecting their fallacies.)
But I have got the feeling that their private parts are small. So small
that it becomes negligable. I think that makes them so frustrated. :)
 
N

Noah Roberts

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.

NR
 
N

Noah Roberts

Mike said:
Chapter and verse please.

You make it sound like you wish to hear a quote from the Bible :p
None of those are completely compliant with the C++ standard,
nor do they claim such.

It is my understanding that *no* compiler claims to be 100% standard
compliant. This of course would make it quite silly to base your
understanding of the standard on what a particular compiler will do.

NR
 
N

Noah Roberts

WW said:
http://homepages.tesco.net/~J.deBoynePollard/FGA/legality-of-void-main.html

A ridiculous page made by someone who cannot even create valid HTML is good
for a laugh, but it does not define the language.

Actually I read the page, it is a rather interesting read. The HTML is
definately broken but this in no way detracts from the content. The
author of this page claims that the *C* standard, through an apparant
grammatical error, allows return types for main other than int. This
page also *explicitly states* that there is no such error in the C++
standard and that int is the required return type of main in this
language.

"The ISO C++ Standard (ISO/IEC 14882:1998) specifically requires main to
return int. "

The author of this page is calling for a corrigendum (
http://dictionary.reference.com/search?q=corrigendum for those like me
who had to look it up :p ) which fixes this problem in the *C* standard.

"In my opinion, this is a defect in the C Standard that needs fixing
with a corrigendum. (I've written a proposed revised wording that such a
corrigendum could use.) It provides the authors of bad C programming
books with the very loophole that they have been needing for the past
decade or so. "

So, in short, they are not trying to redefine the language (actually
they are, to fix it as most C programmers understand it) nor is the
author making any assertation to support The_Sage's deranged ramblings.

NR
 
A

Attila Feher

Noah Roberts wrote:
[SNIP]
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++"

Yep. And it is so legal, that the *C99* standard goes into describing hwo
the program behaves if the return type of main is not compatible with int.
And this part is appartently missing from the C++ standard, showing it
pretty much clear that the intent was not to allow it.
 
A

Attila Feher

Noah said:
Actually I read the page, it is a rather interesting read. The HTML
is definately broken but this in no way detracts from the content.
The author of this page claims that the *C* standard, through an
apparant grammatical error, allows return types for main other than
int.

The page must be old. It is no grammatical error that C99 goes into
detailed description of what will the exit statust returned to the system
afer execution of a program where the return type of main is nto int and is
not compatibel with int.
The author of this page is calling for a corrigendum (
http://dictionary.reference.com/search?q=corrigendum for those like me
who had to look it up :p ) which fixes this problem in the *C*
standard.

It did not happen.
"In my opinion, this is a defect in the C Standard that needs fixing
with a corrigendum. (I've written a proposed revised wording that
such a corrigendum could use.) It provides the authors of bad C
programming books with the very loophole that they have been needing
for the past decade or so. "

Yeah. First I have only browsed through the links given there since those
were what The Rage wanted to present as "as proof". Then I took a quick
look at the HTML because it looked suspicious. Now I think it is old. From
well before 99.
So, in short, they are not trying to redefine the language (actually
they are, to fix it as most C programmers understand it) nor is the
author making any assertation to support The_Sage's deranged
ramblings.

Actually C99 does explicitly allow other return types than int. That is the
way they have chosen to go.
 
M

Marcelo Pinto

The_Sage said:
Oh, I'm so scared... [snip]
just another example of an illiterate asshole who doesn't have a clue. You are [snip]
The Sage

I will cote The Sage the same way he coted the Standard: leaving the
parts that don't suit his need:
"I'm... an illeterate asshole who doesn't have a clue... The Sage"

Gegards,

Marcelo Pinto
 
K

Keroppi

"The_Sage" wrote

ooh, can't find any more thing to misinterpert in the standard and we're
quoting website now are we?
Nice..... how about something from the website of the person who created!
C++. (FYI Sage, coz I don't think you read much to know about these basic
stuff, that person is Bjarne Stroustrup)

http://www.research.att.com/~bs/bs_faq2.html#void-main

"The definition
void main() { /* ... */ }
is not and never has been C++ .... "

"A conforming implementation may provide more versions of main() ( on top of
int main() & int main(int argc, char* argv[]) ), but they must all have
return type int."

BTW, that last sentence refers to that part of the standard that you keep
returning to to try and misinterpert to "prove" that you're right. What the
"implementation-defined" part actually says is that a compiler can be
implemented so to accept different arguements on top of
1) no arguement
2) int argc, char* argv[] .

Just to remind you (or to teach you), coz you don't seems to show ANY
understanding of C++. Apart from the special fact that it's the program
entry point for hosted console program, main() is a FUNCTION like all the
other function one might write. A function whose return type have been
declared void CANNOT return ANY value. When the standard says that a return
of 0 is assumed if no return value is specific by the programmer, it very
well ruled out void main() as being value.

Over and out :)

Kwan Ting
 
P

Phlip

The_Sage said:
You C++ types aren't the brightest group on the web, are you?

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)
 
W

WW

Phlip said:
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
[SNIP]

Did you want to say that not only main is void in this topic? :)
 
W

WW

Mike said:
Kwan Ting wrote: [SNIP]
If you the oh so mighty programmer that you pretend to be, why
don't you
just write some? (And oh, void main is still not allow by the C++
standard.)

Won't you folks all just *plonk* this loser already?

No. I want to see him quote from Chapter 28 of the C++ standard. Then I
will use him to practice my willpower. Whatever b/s he presents, however
abusive he will be - I will simply ignore him. I make lemonade from the
lemon. Once I have seen him quote Chapter 28. ;-)
 
S

SomeDumbGuy

The_Sage wrote:

It does not say "void main cannot return 0". That is your interpretation and
only your interpretation. IBM, MS, and Borland all disagree with you but agree
with me. They all use void main(). Everyone who has ever used those compilers
knows that, so why don't you use one of those compilers and see what you've been
missing?

Here, let me help you embarrass yourself...

http://homepages.tesco.net/~J.deBoynePollard/FGA/legality-of-void-main.html

It's simple: You do not know what you are talking about. Come back when you can
be more civil and actually have some facts instead of childish banter.

The Sage


The site you link to says at the top:

void main() is not legal in C++ but is legal in C.
Below this it says:

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. This comes as a surprise to many people. But despite what many
documents say, including the Usenet comp.lang.c FAQ document (at great
length), the actual text of the C Standard allows for main returning
other types.

Please note the first sentence:
The ISO C++ Standard (ISO/IEC 14882:1998) specifically requires main to
return int.

The Microsoft site at:
http://msdn.microsoft.com./library/...ang_program_startup.3a_.the_main_function.asp

says:
Alternatively, the main and wmain functions can be declared as returning
void (no return value). If you declare main or wmain as returning void,
you cannot return an exit code to the parent process or operating system
using a return statement; to return an exit code when main or wmain are
declared as void, you must use the exit function.

But it does not say that this function is compliant to the standard.

The link for comeau C++ at :
http://www.comeaucomputing.com./4.0/docs/userman/cpplang.html
is from 1997 and talks about the working papers not the final standard.

Digital mars does not say anywhere that I could find that it is
compliant to the standard. The examples are for dos and Windows 3.1.

At this point I think your site needs to be updated. It is not
accurate. If this is your only base for your argument I suggest a new base.
 

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