Connecting Tech Pros Worldwide Forums | Help | Site Map

Amusing Microsoft C++ ad

Bob Nelson
Guest
 
Posts: n/a
#1: Jul 19 '05

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@earthlink.net)
http://www.oldradio.com/archives/nel...computing.html
Good engineering is finding the right wrench to pound in the correct screw
David B. Held
Guest
 
Posts: n/a
#2: Jul 19 '05

re: Amusing Microsoft C++ ad


"Bob Nelson" <bnelson@nelsonbe.com> wrote in message
news:48Ogb.2146$av5.1475@newsread3.news.pas.earthl ink.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


Herb Sutter
Guest
 
Posts: n/a
#3: Jul 19 '05

re: Amusing Microsoft C++ ad


On Wed, 08 Oct 2003 06:28:16 GMT, Bob Nelson <bnelson@nelsonbe.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)
Alf P. Steinbach
Guest
 
Posts: n/a
#4: Jul 19 '05

re: Amusing Microsoft C++ ad


On Wed, 08 Oct 2003 13:19:26 -0700, Herb Sutter <hsutter@gotw.ca> wrote:
[color=blue]
>On Wed, 08 Oct 2003 06:28:16 GMT, Bob Nelson <bnelson@nelsonbe.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.

Bob Bell
Guest
 
Posts: n/a
#5: Jul 19 '05

re: Amusing Microsoft C++ ad


"David B. Held" <dheld@codelogicconsulting.com> wrote in message news:<bm0ehg$716$1@news.astound.net>...[color=blue]
> "Bob Nelson" <bnelson@nelsonbe.com> wrote in message
> news:48Ogb.2146$av5.1475@newsread3.news.pas.earthl ink.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
WW
Guest
 
Posts: n/a
#6: Jul 19 '05

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


galathaea
Guest
 
Posts: n/a
#7: Jul 19 '05

re: Amusing Microsoft C++ ad


"Herb Sutter" wrote:
: On Wed, 08 Oct 2003 06:28:16 GMT, Bob Nelson <bnelson@nelsonbe.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


David B. Held
Guest
 
Posts: n/a
#8: Jul 19 '05

re: Amusing Microsoft C++ ad


"galathaea" <galathaea@excite.com> wrote in message
news:sD%gb.996$uT2.128534593@newssvr21.news.prodig y.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


nospam@nospam.invalid
Guest
 
Posts: n/a
#9: Jul 19 '05

re: Amusing Microsoft C++ ad


Hello Bob Nelson,

On 8-Oct-2003, Bob Nelson <bnelson@nelsonbe.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.

Phlip
Guest
 
Posts: n/a
#10: Jul 19 '05

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


WW
Guest
 
Posts: n/a
#11: Jul 19 '05

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


nospam@nospam.invalid
Guest
 
Posts: n/a
#12: Jul 19 '05

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?

Attila Feher
Guest
 
Posts: n/a
#13: Jul 19 '05

re: Amusing Microsoft C++ ad


nospam@nospam.invalid 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


Closed Thread