Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Conflicting behavior of MS and Borland

Reply
Thread Tools

Conflicting behavior of MS and Borland

 
 
Leor Zolman
Guest
Posts: n/a
 
      05-22-2004
On Fri, 21 May 2004 23:44:08 GMT, Jake Montgomery
<(E-Mail Removed)> wrote:

>
>I dont know if this sheds any light on why MS would have such a language
>extension, but you can use a similar cast on an lvalue in VC7.1 with
>language extensions on.
>
>const int c = 4;
>int n = 5;
>volatile int v = 6;
>
>(const int)n = 6; // Fine in VC 7.1 with extensions
>(int)v = 3; // Fine in VC 7.1 with extensions
>
>(int)c = 3; // illegal
>(unsigned int)n = 7; // illegal
>


Yup, that's consistent with my "pet theory" in my reply to Minti above:
this language extension allows a cast to serve as a type modifier on the
actual lvalue operand, rather than necessarily resulting in an rvalue
temporary as the Standard dictates.

>
>But still ... why?


Indeed. The kicker, to me, is that MSVC 6 does not seem to exhibit this
extension (at least not by default).
-leor

>
> - Jake Montgomery


--
Leor Zolman --- BD Software --- www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
jsp-api.jar and conflicting class after migration from jsf ==> MyFaces Ben Engbers Java 0 02-07-2007 12:11 PM
QUERY: Borland C++ 4.5 vs Borland Turbo C++ 1.01 dhruba.bandopadhyay@hotmail.com C++ 1 10-02-2006 10:57 AM
Conflicting typedef with winnt.h, windef.h and winbase.h Lathe_Biosas C Programming 8 09-02-2005 02:00 AM
Conflicting Web.config between web site and web service Joe ASP .Net 1 10-28-2004 11:14 PM
connection problem - dial-up and broadband conflicting frankg Computer Support 23 09-26-2004 02:52 PM



Advertisments