Amusing Microsoft C++ ad

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Nelson

    Amusing Microsoft C++ ad


    The November 2003 edition of the ``C/C++ Users Journal'' contains a
    multi-paged advertising section for Microsoft's Visual C++. NET 2003
    product.

    One section focuses on the compiler as being one of the most ISO compliant
    on any platform. Overall, the ad is rather interesting and has some
    worthwhile code snippets.

    - The amusing part is the declaration of ``main'' in an example showing
    support for function template specialization:

    void main()

    --
    =============== =============== =============== =============== ===============
    Bob Nelson -- Dallas, Texas, USA (nelsonbe@earth link.net)

    Good engineering is finding the right wrench to pound in the correct screw
  • David B. Held

    #2
    Re: Amusing Microsoft C++ ad

    "Bob Nelson" <bnelson@nelson be.com> wrote in message
    news:48Ogb.2146 $av5.1475@newsr ead3.news.pas.e arthlink.net...[color=blue]
    > [...]
    > - The amusing part is the declaration of ``main'' in an example
    > showing support for function template specialization:
    >
    > void main()[/color]

    Yet further proof that "void main()" is legal C++ because
    Microsoft says so! The Sage has had the last laugh on
    us all!!!

    Dave



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.521 / Virus Database: 319 - Release Date: 9/23/2003


    Comment

    • Herb Sutter

      #3
      Re: Amusing Microsoft C++ ad

      On Wed, 08 Oct 2003 06:28:16 GMT, Bob Nelson <bnelson@nelson be.com> wrote:[color=blue]
      >The November 2003 edition of the ``C/C++ Users Journal'' contains a
      >multi-paged advertising section for Microsoft's Visual C++. NET 2003
      >product.
      >
      >One section focuses on the compiler as being one of the most ISO compliant
      >on any platform. Overall, the ad is rather interesting and has some
      >worthwhile code snippets.
      >
      >- The amusing part is the declaration of ``main'' in an example showing
      > support for function template specialization:
      >
      > void main()[/color]

      I thought that was amusing too. :-)

      FYI, since VC++ 7.0, under /Za you get the following for such code:

      warning C4326: return type of 'main' should be 'int' instead of 'void'

      And everyone should use /Za by default now. In VC++ 7.x the documentation
      writers also did a sweep through all the docs to get rid of "void main()".
      Maybe some escaped (it's always possible to miss a few), but I hope that
      it has already disappeared from the docs.

      Herb

      ---
      Herb Sutter (www.gotw.ca)

      Convener, ISO WG21 (C++ standards committee) (www.gotw.ca/iso)
      Contributing editor, C/C++ Users Journal (www.gotw.ca/cuj)
      Visual C++ architect, Microsoft (www.gotw.ca/microsoft)

      Comment

      • Alf P. Steinbach

        #4
        Re: Amusing Microsoft C++ ad

        On Wed, 08 Oct 2003 13:19:26 -0700, Herb Sutter <hsutter@gotw.c a> wrote:
        [color=blue]
        >On Wed, 08 Oct 2003 06:28:16 GMT, Bob Nelson <bnelson@nelson be.com> wrote:[color=green]
        >>The November 2003 edition of the ``C/C++ Users Journal'' contains a
        >>multi-paged advertising section for Microsoft's Visual C++. NET 2003
        >>product.
        >>
        >>One section focuses on the compiler as being one of the most ISO compliant
        >>on any platform. Overall, the ad is rather interesting and has some
        >>worthwhile code snippets.
        >>
        >>- The amusing part is the declaration of ``main'' in an example showing
        >> support for function template specialization:
        >>
        >> void main()[/color]
        >
        >I thought that was amusing too. :-)
        >
        >FYI, since VC++ 7.0, under /Za you get the following for such code:
        >
        > warning C4326: return type of 'main' should be 'int' instead of 'void'
        >
        >And everyone should use /Za by default now.[/color]

        Considering that VC is mostly used for Windows programming, and that VC
        with option /Za chokes on non-standard constructs in the main Windows API
        header files (such as anonymous unions), are you really sure?

        [color=blue]
        > In VC++ 7.x the documentation
        >writers also did a sweep through all the docs to get rid of "void main()".
        >Maybe some escaped (it's always possible to miss a few), but I hope that
        >it has already disappeared from the docs.[/color]

        T'would be nice if they could get the defaults right wrt. to that non-standard
        beast "WinMain" also. When the GNU folks could, why not Microsoft? Okay, this
        is off-topic, but then, it's one of the most used C++ compilers.

        Comment

        • Bob Bell

          #5
          Re: Amusing Microsoft C++ ad

          "David B. Held" <dheld@codelogi cconsulting.com > wrote in message news:<bm0ehg$71 6$1@news.astoun d.net>...[color=blue]
          > "Bob Nelson" <bnelson@nelson be.com> wrote in message
          > news:48Ogb.2146 $av5.1475@newsr ead3.news.pas.e arthlink.net...[color=green]
          > > [...]
          > > - The amusing part is the declaration of ``main'' in an example
          > > showing support for function template specialization:
          > >
          > > void main()[/color]
          >
          > Yet further proof that "void main()" is legal C++ because
          > Microsoft says so! The Sage has had the last laugh on
          > us all!!![/color]

          And not just any part of Microsoft, either. The marketing department says so.

          Well, if that's good enough for The Sage it's good enough for me.

          Bob

          Comment

          • WW

            #6
            Re: Amusing Microsoft C++ ad

            Bob Bell wrote:[color=blue]
            > And not just any part of Microsoft, either. The marketing department
            > says so.
            >
            > Well, if that's good enough for The Sage it's good enough for me.[/color]

            He would be *very* good in marketing. All you should ensure is that he
            works for the competitor. ;-)

            --
            WW aka Attila


            Comment

            • galathaea

              #7
              Re: Amusing Microsoft C++ ad

              "Herb Sutter" wrote:
              : On Wed, 08 Oct 2003 06:28:16 GMT, Bob Nelson <bnelson@nelson be.com> wrote:
              : >The November 2003 edition of the ``C/C++ Users Journal'' contains a
              : >multi-paged advertising section for Microsoft's Visual C++. NET 2003
              : >product.
              : >
              : >One section focuses on the compiler as being one of the most ISO
              compliant
              : >on any platform. Overall, the ad is rather interesting and has some
              : >worthwhile code snippets.
              : >
              : >- The amusing part is the declaration of ``main'' in an example showing
              : > support for function template specialization:
              : >
              : > void main()
              :
              : I thought that was amusing too. :-)
              :
              : FYI, since VC++ 7.0, under /Za you get the following for such code:
              :
              : warning C4326: return type of 'main' should be 'int' instead of 'void'
              :
              : And everyone should use /Za by default now. In VC++ 7.x the documentation
              : writers also did a sweep through all the docs to get rid of "void main()".
              : Maybe some escaped (it's always possible to miss a few), but I hope that
              : it has already disappeared from the docs.

              In 7.0 there are certainly quite a lot of MSDN help pages / docs/ etc. that
              still have the void main(). In fact, there are some docs that have both int
              main() and void main() on the same page!


              --
              /////////////////////////////////////////////

              galathaea: prankster, fablist, magician, liar


              Comment

              • David B. Held

                #8
                Re: Amusing Microsoft C++ ad

                "galathaea" <galathaea@exci te.com> wrote in message
                news:sD%gb.996$ uT2.128534593@n ewssvr21.news.p rodigy.com...[color=blue]
                > [...]
                > In fact, there are some docs that have both int
                > main() and void main() on the same page![/color]

                Yet further proof that if the implementation allows "int main()",
                then "void main()" is also legal! Will wonders never cease??

                Dave



                ---
                Outgoing mail is certified Virus Free.
                Checked by AVG anti-virus system (http://www.grisoft.com).
                Version: 6.0.521 / Virus Database: 319 - Release Date: 9/23/2003


                Comment

                • nospam@nospam.invalid

                  #9
                  Re: Amusing Microsoft C++ ad

                  Hello Bob Nelson,

                  On 8-Oct-2003, Bob Nelson <bnelson@nelson be.com> wrote:
                  [color=blue]
                  > - The amusing part is the declaration of ``main'' in an example showing
                  > support for function template specialization:
                  >
                  > void main()[/color]

                  I really don't understand how Microsoft managed to make the worlds most
                  powerful and easy to use OS's.

                  Comment

                  • Phlip

                    #10
                    Re: Amusing Microsoft C++ ad

                    > > - The amusing part is the declaration of ``main'' in an example showing[color=blue][color=green]
                    > > support for function template specialization:
                    > >
                    > > void main()[/color]
                    >
                    > I really don't understand how Microsoft managed to make the worlds most
                    > powerful and easy to use OS's.[/color]

                    By letting others do their research for them, then skimming off what worked
                    and re-engineering it.

                    For example, everyone else's standard is "int main". So MS's standard is
                    "void main" - it's non-standard, a little "better", and addresses a known
                    market.

                    --
                    Phlip


                    Comment

                    • WW

                      #11
                      Re: Amusing Microsoft C++ ad

                      Phlip wrote:[color=blue]
                      > For example, everyone else's standard is "int main". So MS's standard
                      > is "void main" - it's non-standard, a little "better", and addresses
                      > a known market.[/color]

                      It is not MS standard. It is backwards compatibility to their old
                      compilers.

                      --
                      WW aka Attila


                      Comment

                      • nospam@nospam.invalid

                        #12
                        Re: Amusing Microsoft C++ ad

                        Hello WW,

                        On 13-Oct-2003, "WW" <wolof@freemail .hu> wrote:
                        [color=blue]
                        > It is not MS standard. It is backwards compatibility to their old
                        > compilers.[/color]

                        Are you serious?

                        Comment

                        • Attila Feher

                          #13
                          Re: Amusing Microsoft C++ ad

                          nospam@nospam.i nvalid wrote:[color=blue]
                          > Hello WW,
                          >
                          > On 13-Oct-2003, "WW" <wolof@freemail .hu> wrote:
                          >[color=green]
                          >> It is not MS standard. It is backwards compatibility to their old
                          >> compilers.[/color]
                          >
                          > Are you serious?[/color]

                          Nope. I am Attila, who also calls himself White Wolf. And yes, it is a
                          backward compatibility thing.

                          --
                          Attila aka WW


                          Comment

                          Working...