Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / February 2004



Tip: Looking for answers? Try searching our database.

Compiles for Mac OS X, but not Win32?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 24 Feb 2004 19:00 GMT
Hi,

On CW 9.1 running on OS X Panther 10.3.2...

The following snippet of code will compile with the Win32 compiler, but will
fail on the PPC compiler...

class Foo
{
public:
   Foo::Foo() { /* ... */ } // <-- declaration syntax error
};

All C++ language settings are identical on the 2 targets.

OK, it was my mistake because I cut and pasted the constructor to inline it,
but I was surprised to see different results with the 2 compilers.

Signature

Regards,
Steve.

Steve - 24 Feb 2004 19:02 GMT
On 24/2/04 7:00 pm, in article BC614FC6.5B8D4%postmaster@127.0.0.1, "Steve"
<postmaster@127.0.0.1> wrote:

> Hi,
>
> On CW 9.1 running on OS X Panther 10.3.2...

Oops, btw the compilers are all

Version 3.2.1 build 392 18/11/03 10.34am

Steve.
MW Ron - 24 Feb 2004 21:58 GMT
>Hi,
>
[quoted text clipped - 13 lines]
>OK, it was my mistake because I cut and pasted the constructor to inline it,
>but I was surprised to see different results with the 2 compilers.

Me too,  My guess is that it is necessary in order to support MFC or
something like that.   I'll ask engineering.  In any case the Mac is
right, and the Windows compiler should have shown an error.

Ron

Signature

Announcing  CodeWarrior Development Tools for Windows v9.2
http://www.metrowerks.com/MW/Develop/Desktop/Windows/Professional/Default.htm
Ron Liechty - MWRon@metrowerks.com - <http://www.metrowerks.com>

Steve - 24 Feb 2004 22:53 GMT
On 24/2/04 9:58 pm, in article mwron-4DF6B9.16582924022004@news.newsguy.com,

> Me too,  My guess is that it is necessary in order to support MFC or
> something like that.   I'll ask engineering.  In any case the Mac is
> right, and the Windows compiler should have shown an error.

OK, would you like me to raise this 'problem' through the official channels
anyway?

> Ron

Steve.
MW Ron - 25 Feb 2004 14:06 GMT
>On 24/2/04 9:58 pm, in article mwron-4DF6B9.16582924022004@news.newsguy.com,
>
[quoted text clipped - 4 lines]
>OK, would you like me to raise this 'problem' through the official channels
>anyway?

No... This is an MS extension that we support for compatibility.

"#pragma cpp_extensions on"

controls this and is enabled for Win32 compilers by default and is not
controlled by ANSI strict.

Ron

Signature

Announcing  CodeWarrior Development Tools for Windows v9.2
http://www.metrowerks.com/MW/Develop/Desktop/Windows/Professional/Default.htm
Ron Liechty - MWRon@metrowerks.com - <http://www.metrowerks.com>

Steve - 25 Feb 2004 19:08 GMT
On 25/2/04 2:06 pm, in article mwron-50609A.09062425022004@news.newsguy.com,

>> On 24/2/04 9:58 pm, in article mwron-4DF6B9.16582924022004@news.newsguy.com,
>>
[quoted text clipped - 13 lines]
>
> Ron

Thanks Ron. I saw Ben's post too.

As we don't use MFC, I've turned cpp_extensions off in my preprocessor
panel.

Cheers,
Steve.
Ben Combee - 25 Feb 2004 06:48 GMT
>>The following snippet of code will compile with the Win32 compiler, but will
>>fail on the PPC compiler...
[quoted text clipped - 13 lines]
> something like that.   I'll ask engineering.  In any case the Mac is
> right, and the Windows compiler should have shown an error.

Yes, this is a C++ language extension that we added to the x86 compiler
to get MFC to build, since MS had used the invalid syntax in a couple of
their classes.  The C++ standard explicitly disallows class-qualified
names in the declaration of a class.
Signature

Ben Combee <bcombee@metrowerks.com>
CodeWarrior for Palm OS technical lead
Palm OS programming help at http://www.palmoswerks.com/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.