The_Sage & void main()

T

The_Sage

Reply to article by: "Randall Hyde said:
Date written: Mon, 29 Sep 2003 04:11:51 GMT
MsgID:<[email protected]>
I suspect...

Every one of these operating
systems provides the ability to query the program's return value. For example,
as a Windows programmer, surely you've come across the ExitProcess API
call.

You don't know what you are talking about as usual. ExitProcess() is not the
same thing as int main(). From the MSDN site...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/exitprocess.asp

ExitProcess...

The ExitProcess function ends a process and all its threads.

Parameters: uExitCode...

Exit code for the process and all threads terminated as a result of this
call. Use the GetExitCodeProcess function to retrieve the process's exit
value. Use the GetExitCodeThread function to retrieve a thread's exit value.

Return Values...

This function does not return a value.

See that? THIS FUNCTION DOES NOT RETURN A VALUE. Which word didn't you
understand this time?

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: Sun, 28 Sep 2003 19:26:09 -0700
MsgID:<[email protected]>
Now that I have upgraded my newsreader I can finally do this. You will
be the first person I have ever done this to on usenet ever.

Ah, yet another intellectual coward who can't defend their personal opinion with
facts has ran away. See ya! Have fun in Never Never Land!

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: "Attila Feher said:
Date written: Mon, 29 Sep 2003 13:57:16 +0300
MsgID:<[email protected]>
I am not changing the subject.

No one said you were. I wasn't talking to you and since you have nothing I
consider intelligent enough to respond to (other than that long awaited response
from the last post to you about what the standard clearly states "shall...but
otherwise" means in plain english), see ya!

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:
Exit code for the process and all threads terminated as a result of
this call. Use the GetExitCodeProcess function to retrieve the
process's exit value. Use the GetExitCodeThread function to
retrieve a thread's exit value.

Return Values...

This function does not return a value.

See that? THIS FUNCTION DOES NOT RETURN A VALUE. Which word didn't you
understand this time?

You are really really hopelessly clueless. I have only quoted in your
pathetic attempt to be technical so that as long as the USENET is archived
people will see it twice and laugh their S-es off twice on how clueless you
are.
 
R

Randall Hyde

The_Sage said:
You are forgiven. You couldn't handle the last debate so there isn't any
indication you are going to stick up for someone else any better.

The Sage

Well, I noticed how you avoided answering the question completely.
True to form, as usual.
Cheers,
Randy Hyde
 
A

Attila Feher

The_Sage said:
No one said you were. I wasn't talking to you and since you have
nothing I consider intelligent enough to respond to (other than that
long awaited response from the last post to you about what the
standard clearly states "shall...but otherwise" means in plain
english), see ya!

Care to read my signature. If you do so, you won't make yourself look more
pathetic than you are - if it is ever possible. I am not going to respond
you until you prove me that you have the standard and you do it by telling
me what Chapter 28 says about the main function. Until you do so I have to
assume (based on the fool language and the absolute incompetence shown by
all your posts) is that you do not have the standard and you are a liar.
 
A

Attila Feher

The_Sage said:
Ah, yet another intellectual coward who can't defend their personal
opinion with facts has ran away. See ya! Have fun in Never Never Land!

Or maybe it is a sign that people start to realize that you are a boring,
not even annoying enough pathetic troll, who is not able to show up any
effort or any debating skills except for personal insults, repetition of
fallacies and lies.

Get that Chapter 28 of the standard and let me know what it say about the
main function. Unless you do so I will see my point proven and furtermore I
will see it proven that you not only do not have the standard but you are a
clueless, incompetent liar.
 
S

SomeDumbGuy

Mike said:
Thank you for being gracious about this, and I do apologize
if I've offended you. But did you not see the smiley
after what I wrote? It indicated (apparently unsuccessfuly)
that my remark was to be taken as a friendly jibe. But in
general you are right, sometimes I can be a "smartass."
I'll work on it. :)

-Mike

Thank you.
I have been told in the past that I am too sensitive.
I will work on that. Thank you for putting up with me.
 
T

The_Sage

Reply to article by: "Attila Feher said:
Date written: Tue, 30 Sep 2003 08:13:06 +0300
MsgID:<[email protected]>

Please stop posting anymore Severly Abusive Gibberish Emittions. Troll
somewhere else Attilia Fuher.

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: "WW said:
Date written: Tue, 30 Sep 2003 06:38:56 +0300
MsgID:<[email protected]>
You are really really hopelessly clueless. I have only quoted in your
pathetic attempt to be technical so that as long as the USENET is archived
people will see it twice and laugh their S-es off twice on how clueless you
are.

I have the last laugh and it is on you. The return value is listed for
ExitProcess(), not GetExitCodeProcess() or GetExistCodeThread(). To prove that,
here is the link that you snipped so that people couldn't verfify that I am
being honest and you are being stupid...

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/exitprocess.asp

It clearly states that ExitProcess() does not return a value. More importantly
ExitProcess() does not terminate an application, it terminates a process,
therefore int main() isn't applicable in this case. See what you get for making
things up out of thin air instead of doing legitimate research?

And speaking of being archived in the USENET, I remember your blatent blunder of
confusing RETURN TYPE with PARAMETER. Remember that one! Bwahahaha! I will just
add this latest blatent blunder of yours to that one. Bwahahaha!

http://groups.google.com/[email protected]#link21

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: "Attila Feher said:
Date written: Tue, 30 Sep 2003 08:16:13 +0300
MsgID:<[email protected]>
Or maybe it is a sign that people start to realize that you are a boring,

You can't read minds so stop making that crap up.
not even annoying enough pathetic troll, who is not able to show up any
effort or any debating skills except for personal insults, repetition of
fallacies and lies.

You are the only one doing that....
Unless you do so I will see my point proven and furtermore I
will see it proven that you not only do not have the standard but you are a
clueless, incompetent liar.

See what I mean? You are hopelessly immature. I do not respond to nonsense like
yours and I should have killfilled you, but I am thinking making your nonsense
into a T-shirt. Think about it. It will detect any decent C++ programmer without
a need to say a word. This should make anyone knowing C++ at least laugh. But I
am still afraid that in such a T-shirt I might get attacked...

By the way folks, here is that part from the ISO Standard that you still can't
tell us what it means...

3.6.1 Main function paragraph 2:
"It shall have a return type of type int
-->BUT<--
otherwise its type is implementation-defined"

To help you along, I'm giving you a few clues. Here is a link to a dictionary,
that defines what the words "but" and "otherwise" mean...

http://www.yourdictionary.com/ahd/b/b0577100.html and
http://www.yourdictionary.com/ahd/o/o0147100.html

Look up the meaning on those two words and report back to us if they imply
anything other than some exceptions were to follow as used in the sentence
above. Please quote the dictionary for us when you do your "analysis", so we can
compare your version to reality.

Looking forward to more of your clueless, incompetent lying.

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

Alan Morgan

The_Sage said:
By the way folks, here is that part from the ISO Standard that you still can't
tell us what it means...

3.6.1 Main function paragraph 2:
"It shall have a return type of type int
-->BUT<--
otherwise its type is implementation-defined"

Rules for Naming Childen:
The child shall have the same last name as that of the parents
BUT
otherwise the name can be decided by the parents.

(Let's ignore the fact that there is no such rule, mkay?)

Sage's Interpretation:
Children do not have to have the parent's last name

Everyone Else's Interpretation:
Children have to have their parent's last name but the parents can pick
the first and middle name.



Rules for Working Hours
The employee must be in the office from 10AM to 2PM
BUT
otherwise may set their own work hours as long as they
work 40 hours a wekk.

Sage's Interpretation
I can work whatever hours I like. Even 3PM to 11PM.

Everyone Else's Interpretation:
I can work early (6AM - 2PM) or late (10AM - 6PM) but I have
to be around from 10AM to 2PM.



Rules for Being an Idiot:
All idiots must be called The Sage
BUT
otherwise there are no restrictions on who can be an idiot.

Sage's Intpretation:
There are absolutely no restrictions on who can be an idiot.

Everyone Else's Interpretation:
Sometimes it seems that way...


Alan
 
M

Mike Wahler

[ad hominems snipped]

(Sorry Attila, I just can't resist this one.
It's just too easy :) )

Here we go:
By the way folks, here is that part from the ISO Standard that you still can't
tell us what it means...

3.6.1 Main function paragraph 2:
"It shall have a return type of type int
-->BUT<--
otherwise its type is implementation-defined"

Nice try. You should be a lawyer. They're specially trained
in omitting and falsifying context. (Actually, you've
done a poor job of that anyway). Here's the *full text*
of 3.6.1 / 2 from which you 'cherry-picked' a few words out of
context in a pathetic attempt to support your indefensible
position:

<begin quote>

3.6.1 Main function

2 An implementation shall not predefine the main function.
This function shall not be overloaded. It shall have a
return type of type int, but otherwise its type is
implementation­-defined. All implementations shall allow
both of the following definitions of main:

int main() { /* ... */ }

and

int main(int argc, char* argv[]) { /* ... */ }

In the latter form argc shall be the number of arguments
passed to the program from the environment in which the
program is run. If argc is nonzero these arguments shall
be supplied in argv[0] through argv[argc­1] as pointers to
the initial characters of null­terminated multibyte strings
(NTMBSs) (17.3.2.1.3.2) and argv[0] shall be the pointer
to the initial character of a NTMBS that represents the
name used to invoke the program or "". The value of argc
shall be nonnegative. The value of argv[argc] shall be 0.
[Note: it is recommended that any further (optional) parameters
be added after argv. ]

<end quote>

Note that *both* of the *only* two allowed forms
have a return type of 'int'.
To help you along, I'm giving you a few clues. Here is a link to a
dictionary,
that defines what the words "but" and "otherwise" mean...

To help you along, please read a book about English syntax
and semantics.

*Immediately* following the second sentence of
clause 2 above:

"This function shall not be overloaded.",

is the sentence:

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

To anyone with even a rudimentary understanding of
English, it is quite obvious that the words "it"
and "its" refer to the noun 'function' in the
preceding sentence. "its type" means "the function's
type", not "the funtion's return type".

As you have, anyone can remove or alter intended meaning
of any word(s) or phrase(s) by taking them out of context.
Lawyer 101.
and report back to us if they imply
anything other than some exceptions were to follow as used in the sentence
above.

The exceptions are about the function's type, not its
return type. If you don't know the difference:

<begin quote>

3.9 Types

1 [Note: 3.9 and the subclauses thereof impose requirements on
implementations regarding the representation of types. There
are two kinds of types: fundamental types and compound types.
Types describe objects (1.8), references (8.3.2), or functions
(8.3.5). ]

<end quote>

and...

<begin quote>

3.9.2 Compound types

1 Compound types can be constructed in the following ways:

-- arrays of objects of a given type, 8.3.4;

-- functions, which have parameters of given types and return
void or references or objects of a given type, 8.3.5;

-- pointers to void or objects or functions (including static
members of classes) of a given type, 8.3.1;

-- references to objects or functions of a given type, 8.3.2;

-- classes containing a sequence of objects of various types
(clause 9), a set of types, enumerations and functions for
manipulating these objects (9.3), and a set of restrictions
on the access to these entities (clause 11);

-- unions, which are classes capable of containing objects of
different types at different times, 9.5;

-- enumerations, which comprise a set of named constant values.
Each distinct enumeration constitutes a different enumerated
type, 7.2;

-- pointers to non­static class members, which identify members
of a given type within objects of a given class, 8.3.3.

<end quote>

Note how I included the full text, in context.
Please quote the dictionary for us when you do your "analysis", so we can
compare your version to reality.

The dictionary meanings of words is not the point here,
the point is that you've purposely presented the words
out of context, in an attempt to assign whatever meaning
you feel supports your position.

If you cannot understand all of what I've written and
quoted above, not only do you not understand C++, you
don't understand English.
Looking forward to more of your clueless, incompetent lying.

I look forward to you ceasing your disruption of our forum with
your ravings. So:

You're right, and everyone else (including the authors of
the ISO standard document) is wrong. I hope my saying that
makes you feel better, since 'being right' is obviously your
only agenda here (other than disrupting our forum).

Bye, now.

*PLONK*

-Mike
 
A

Attila Feher

The_Sage said:
Please stop posting anymore Severly Abusive Gibberish Emittions.
Troll somewhere else Attilia Fuher.

Have you realized that Severly Abusive Gibberish Emittions has your name for
abbreviation? You are more pathetic than I thought anyone can ever be.
Learn to read. My name is Feher. Not Fuher. And Attila. Not Attilia.
Which it could not even be, since the double t is not pronounced. I
suspected that you cannot read or think. But thank you for proving it.

The clock is ticking! You have 23 hours and 55 minutes left to post what
the C++ standard says about the main function - or loose all your arguments
due to proven incompetence.
 
A

Attila Feher

The_Sage wrote:
[SNIPPED Microsoft propriatery and nonsense]
You are really really hopelessly clueless. Time is ticking. Post Chapter
28 or crawl away.
 
A

Attila Feher

The_Sage said:
You can't read minds so stop making that crap up.

At least unlike you, I can read English.
You are the only one doing that....

And I thought you cannot get lower and more infantile and pathetic. But you
can!

Hm. You have cut out The Request. No problem. I can repeat it as many
times as it takes so that everyone will see you are clueless. My request is
very simple. Anyone who has or knows the standard well enough can answer it
withing 5 seconds. You cannot. Hm. What does that mean? Oh yeah! That
you are incompetent.
See what I mean? You are hopelessly immature. I do not respond to
nonsense like yours and I should have killfilled you, but I am
thinking making your nonsense into a T-shirt. Think about it. It will
detect any decent C++ programmer without a need to say a word. This
should make anyone knowing C++ at least laugh. But I am still afraid
that in such a T-shirt I might get attacked...

You have copied that text from one of my posts, you hopelessly clueless
troll. You did that so without TELLING, which is again a mean, pathetic and
infantile thing to do. But hey! You are here to humuliate yourself, and so
far you are doing a very good job at it.

And let me repeat what you were requested and failed to do for a week now:

Get that Chapter 28 of the standard and let me know what it say about the
main function. Unless you do so I will see my point proven and furtermore I
will see it proven that you not only do not have the standard but you are a
clueless, incompetent liar and you have lost all your arguments here. The
time is ticking. You have 23 hours and 50 minutes left.
 
R

RS

The_Sage said:
3.6.1 Main function paragraph 2:
"It shall have a return type of type int
-->BUT<--
otherwise its type is implementation-defined"

ISO/IEC 14882:1998 - "Programming languages - C++", 3.6.1, paragraph 2:

"
An implementation shall not predefine the main function. This function
shall not be overloaded. It shall have a return type of int, but
otherwise its type is implementation-defined. All implementations shall
allow both of the following definitions of main:

int main () { /* ... */ }

...and..

int main (int argc, char* argv []) { /* ... */ }
"

Again:

"It [the ISO-C++ implementation (of the function main)] shall [meaning
it is a requirement] have a return type of int, but otherwise its type
is implementation-defined."

Instead of prohibiting an ISO-C++-implementation from supporting other
return types (for whatever reasons that may be), it states that only a
return type of int is defined as part of the ISO-C++ standard and must
be supported, thus returning anything else makes the program
non-standard in they eyes of the ISO-C++-definition of a return type.

To illustrate and summarize:

void main () { /* implementation-defined, non-standard */ }
int main () { /* ISO-C++-defined, standard */ }
float main () { /* implementation-defined, non-standard */ }
bool main () { /* implementation-defined, non-standard */ }
....
 
J

Jonathan Mcdougall

"It [the ISO-C++ implementation (of the function main)] shall [meaning
it is a requirement] have a return type of int, but otherwise its type
is implementation-defined."

Instead of prohibiting an ISO-C++-implementation from supporting other
return types (for whatever reasons that may be), it states that only a
return type of int is defined as part of the ISO-C++ standard and must
be supported, thus returning anything else makes the program
non-standard in they eyes of the ISO-C++-definition of a return type.

To illustrate and summarize:

void main () { /* implementation-defined, non-standard */ }
int main () { /* ISO-C++-defined, standard */ }
float main () { /* implementation-defined, non-standard */ }
bool main () { /* implementation-defined, non-standard */ }

It is not implementation-defined, it is undefined behavior.


Jonathan
 
R

Ron Natalie

Jonathan Mcdougall said:
It is not implementation-defined, it is undefined behavior.

Actually, it's ill-formed. The compiler is required to issue a diagnostic.
If it were undefined behavior, it wouldn't even have to do that.
 

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,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top