473,695 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Virtual bool bug in VS2005 ?

Hello,

Does anyone know if the "virtual bool bug" is still present in VS2005 when
calling between managed and unmanaged code?

Thanks

Kevin
Nov 17 '05 #1
5 1105
Kevin Frey wrote:
Hello,

Does anyone know if the "virtual bool bug" is still present in VS2005
when calling between managed and unmanaged code?


No, it's fixed.

-cd
Nov 17 '05 #2
Carl Daniel [VC++ MVP] wrote:
Kevin Frey wrote:
Hello,

Does anyone know if the "virtual bool bug" is still present in VS2005
when calling between managed and unmanaged code?


No, it's fixed.


The good question being : where has it been fixed? In the compiler or in the
..NET runtime ;-)

Arnaud
MVP - VC
Nov 17 '05 #3
Hi Arnaud!
Does anyone know if the "virtual bool bug" is still present in VS2005
when calling between managed and unmanaged code?


No, it's fixed.


The good question being : where has it been fixed? In the compiler or in the
..NET runtime ;-)


The compiler was not the problem... the problem occured during the
unmanaged-to-managed transition, so it must be fixed in the .NET-Framework.
For the VC7(.1) bug see:
http://www.codeproject.com/buglist/virtualboolbug.asp

I just can remember the reason for this bug: The compiler and the
framework team discussed who should solve the problem (and then they
forgot to solve it :-) )

The CLR team said the "bool(ean)" is 4 bytes and the C++-teams says
"bool" is 1-byte.
And I think it was hard for the C++-team to change the size of bool from
1 to 4 ;-)

Therefor the C++-team has done everything correct...
So for VC8 the C++-team still just set the lower 8-bit of the
EAX-register (called AL).
And the conversion from AL to EAX (1-byte to 4-byte) is done by the
..NET-Framework (mscorwks!PInvo keCalliPostCall ).

So the CLR-team has done the conversion...
PS: But for the VC7.1 bug it seems that the C++-team had to solve the
bug (see: http://support.microsoft.com/kb/823071/en-us)

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #4

Jochen Kalmbach [MVP] wrote:
Hi Arnaud! Hello Jochen,

The good question being : where has it been fixed? In the compiler or in the
..NET runtime ;-)


The compiler was not the problem... the problem occured during the
unmanaged-to-managed transition, so it must be fixed in the .NET-Framework.
For the VC7(.1) bug see:
http://www.codeproject.com/buglist/virtualboolbug.asp

I just can remember the reason for this bug: The compiler and the
framework team discussed who should solve the problem (and then they
forgot to solve it :-) )


Yep : that's why I ask the question ;-)
The CLR team said the "bool(ean)" is 4 bytes and the C++-teams says
"bool" is 1-byte.
And I think it was hard for the C++-team to change the size of bool from
1 to 4 ;-)


What is really strange (with framework 1.0 and 1.1) is that, during the
transition return from unmanaged to managed, if the 3 upper bytes of
EAX are !=0, then the framework sets EAX=0x1 (at least, it is how I
have understood the problem...)

Arnaud
MVP - VC

Nov 17 '05 #5
Hi adebaene
What is really strange (with framework 1.0 and 1.1) is that, during the
transition return from unmanaged to managed, if the 3 upper bytes of
EAX are !=0, then the framework sets EAX=0x1 (at least, it is how I
have understood the problem...)


Thats not strange, thats the conversion from "4-byte-value" to
"System::Boolea n"...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11324
by: Alex Vinokur | last post by:
========================================= Windows 2000 CYGWIN_NT-5.0 1.3.22(0.78/3/2) GNU gcc version 3.2 20020927 (prerelease) ========================================= Here is some program which is compiled and works fine. ############################################
1
2339
by: A. Saksena | last post by:
Hi all, I am trying to compile following code :- ======================================= #include <iostream.h> #include <string> namespace tlm { template <typename REQUEST, typename RESPONSE > class tlm_transport_if {
7
1772
by: Frank-René Schäfer | last post by:
Case: -- class X has occupies tiny amount of memory: sizeof(X) is only a little greater than sizeof(void*). -- X instantiates thousands of objects and memory does matter. -- The class has a virtual destructor, and therefore, a pointer to a virtual function table.
8
17759
by: Floogle | last post by:
how do i create a virtual == operator. I've tried the following but it's incorrect... class Interface { ... public: virtual bool operator==(const Interface& rhs)const=0;
3
3936
by: Chris | last post by:
I am having a very strange problem involving virtual functions in template classes. First of all, here is an extremely simplified structure of the two classes I am having problems with. template<class Type> class base { public: base& operator/=(const base&); Type *image;
1
1598
by: Bern McCarty | last post by:
What do you make of this? I cannot tell for sure but it almost seems as the the transition thunk to get back from the native bool method to the managed caller is looking at eax and, if any bit is set, normalizing it to 0x00000001. If it wants to normalize the value then it should only operate on the al register since that's all that the native bool method uses to hold the return value. Is this a known VC 7.1 bug? Is there a hotfix...
12
2660
by: mijobee | last post by:
I'm very new to c++ and just writing some code to learn. I've run into a problem, with a javaish design, and want to know if there is any possible solution without modifying the design. I've read up on virtual inheritance and from my understanding this should work fine but I haven't found any docs that use such a tangled example. The gcc output containing the errrors: Example.cpp: In member function 'virtual IObject*...
5
11349
by: druberego | last post by:
I read google and tried to find the solution myself. YES I do know that you can get undefined references if you: a) forget to implement the code for a prototype/header file item, or b) you forget to pass all the necessary object files to the linker. Neither of those are my problem. Please bear with me as the question I ask is rather long and I think it's beyond a CS101 level of linker stupidity. If it is a stupid CS101 mistake I'm making...
11
2415
by: Chris Thomasson | last post by:
Consider an an object that that can has 7 or 8 functions. If you create an abstract base class for the "interface" of the object, well, that means 7 or 8 pure virtual functions right? Well, IMHO, that's way too much... I was wondering if the following technique is "frowned" upon: <pseudo-code> _____________ typedef struct ... vztimespec_t;
0
8638
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9120
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8857
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8831
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7668
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4586
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3013
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2278
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1979
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.