The_Sage & void main()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Attila Feher

    #31
    Re: The_Sage & void main()

    Noah Roberts wrote:[color=blue]
    > Mike Wahler wrote:[color=green]
    >> Chapter and verse please.[/color]
    >
    > You make it sound like you wish to hear a quote from the Bible :P[/color]

    That is the idea. It is a joke.
    [color=blue][color=green][color=darkred]
    >>> such as IBM, MS, and Borland, yet they are all
    >>> ISO compliant.[/color]
    >>
    >> None of those are completely compliant with the C++ standard,
    >> nor do they claim such.[/color]
    >
    > It is my understanding that *no* compiler claims to be 100% standard
    > compliant.[/color]

    Not true. Comeau(*) does claim. And it is, unless someone finds a bug.

    (*) http://www.comeaucomputing.com

    Good site, look at it.

    --
    Attila aka WW


    Comment

    • Attila Feher

      #32
      Re: The_Sage & void main()

      Noah Roberts wrote:[color=blue]
      > WW wrote:
      >[color=green]
      >>
      >>[/color][/color]
      http://homepages.tesco.net/~J.deBoyn...void-main.html[color=blue][color=green]
      >>
      >> A ridiculous page made by someone who cannot even create valid HTML
      >> is good for a laugh, but it does not define the language.[/color]
      >
      > 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.[/color]

      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.
      [color=blue]
      > 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.[/color]

      It did not happen.
      [color=blue]
      > "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. "[/color]

      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.
      [color=blue]
      > 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.[/color]

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

      --
      Attila aka WW


      Comment

      • Attila Feher

        #33
        Re: The_Sage & void main()

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

        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.

        --
        Attila aka WW


        Comment

        • Marcelo Pinto

          #34
          Re: The_Sage & void main()

          The_Sage <theeSage@azrmc i.net> wrote in message news:<0k05nvggt 23onbmcm80fs3tj ig4rt9gh2c@4ax. com>...
          The Sage wrote:[color=blue]
          > Oh, I'm so scared...[/color]
          [snip][color=blue]
          > just another example of an illiterate asshole who doesn't have a clue. You are[/color]
          [snip][color=blue]
          > The Sage[/color]

          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

          Comment

          • Keroppi

            #35
            Re: The_Sage &amp; void main()


            "The_Sage" wrote[color=blue]
            >
            >[/color]
            http://homepages.tesco.net/~J.deBoyn...void-main.html[color=blue]
            >[/color]

            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)

            Driving innovation for over 140 years, AT&T Labs is the global leader in development and research of connectivity and technological advancement


            "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
            "implementa tion-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
            --
            Experience is a good school but the fees are high.
            - Heinrich Heine


            Comment

            • Phlip

              #36
              Re: The_Sage &amp; void main()

              "The_Sage" wrote:
              [color=blue]
              > You C++ types aren't the brightest group on the web, are you?[/color]

              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)

              --
              Phlip


              Comment

              • WW

                #37
                Re: The_Sage &amp; void main()

                Phlip wrote:[color=blue]
                > "The_Sage" wrote:
                >[color=green]
                >> You C++ types aren't the brightest group on the web, are you?[/color]
                >
                > 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[/color]
                [SNIP]

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

                --
                WW aka Attila


                Comment

                • Mike Smith

                  #38
                  Re: The_Sage &amp; void main()

                  Kwan Ting wrote:
                  [color=blue]
                  > The_Sage, I see you've gotten yourself a twin asking for program in
                  > comp.lang.c++ .
                  > http://groups.google.co.uk/groups?hl...c71c33c&rnum=1
                  > 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.)[/color]

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

                  --
                  Mike Smith

                  Comment

                  • WW

                    #39
                    Re: The_Sage &amp; void main()

                    Mike Smith wrote:[color=blue]
                    > Kwan Ting wrote:[/color]
                    [SNIP][color=blue][color=green]
                    >> 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.)[/color]
                    >
                    > Won't you folks all just *plonk* this loser already?[/color]

                    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. ;-)

                    --
                    WW aka Attila


                    Comment

                    • SomeDumbGuy

                      #40
                      Re: The_Sage &amp; void main()

                      The_Sage wrote:

                      [color=blue]
                      >
                      > 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.deBoyn...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[/color]


                      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/d...n_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/...n/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.

                      Comment

                      • SomeDumbGuy

                        #41
                        Re: The_Sage &amp; void main()

                        Mike Smith wrote:

                        [color=blue]
                        >
                        > Won't you folks all just *plonk* this loser already?
                        >[/color]

                        What is *plonk*?

                        Comment

                        • Mike Wahler

                          #42
                          Re: [OT] The_Sage &amp; void main()

                          "SomeDumbGu y" <abuse@127.0.0. 1> wrote in message
                          news:hE2db.1021 5$FH3.49@nwrddc 02.gnilink.net. ..[color=blue]
                          > Mike Smith wrote:
                          >
                          >[color=green]
                          > >
                          > > Won't you folks all just *plonk* this loser already?
                          > >[/color]
                          >
                          > What is *plonk*?[/color]

                          What is google?



                          I suppose you are posting with the proper handle. :-)

                          -Mike


                          Comment

                          • Kwan Ting

                            #43
                            Re: The_Sage &amp; void main()


                            "Mike Smith" wrote .)[color=blue]
                            >
                            > Won't you folks all just *plonk* this loser already?
                            >[/color]

                            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
                            --
                            Experience is a good school but the fees are high.
                            - Heinrich Heine


                            Comment

                            • Kwan Ting

                              #44
                              Re: The_Sage &amp; void main()

                              ROFLMAO

                              Nice research mate :-D


                              Comment

                              • Greg Comeau

                                #45
                                Re: The_Sage &amp; void main()

                                In article <3F73CEE8.50005 08@dontemailme. com>,
                                Noah Roberts <nroberts@donte mailme.com> wrote:[color=blue]
                                >The_Sage wrote:[color=green][color=darkred]
                                >>>Reply to article by: Noah Roberts <nroberts@donte mailme.com>
                                >>>>http://homepages.tesco.net/~J.deBoyn...void-main.html[/color]
                                >>[color=darkred]
                                >>>Have you read this link? Here is a nice little quote for yah (from the
                                >>>above :P):[/color]
                                >>[color=darkred]
                                >>>"The ISO C++ Standard (ISO/IEC 14882:1998) specifically requires main to
                                >>>return int."[/color]
                                >>
                                >> 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 "implementa tion-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.[/color]
                                >
                                >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.[/color]

                                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.
                                --
                                Greg Comeau/4.3.3:Full C++03 core language + more Windows backends
                                Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout
                                World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
                                Comeau C/C++ with Dinkumware's Libraries... Have you tried it?

                                Comment

                                Working...