Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is this a serious bug in BCB6 Enterprise?

2 views
Skip to first unread message

Cheng-Yuan Bell Hsu

unread,
Mar 29, 2002, 6:28:52 AM3/29/02
to
DA

I found a serious bug in Borland C++ Builder 6 Enterpise upgrade with
Update Pack 1 was installed. You could try the following line.

int n = sizeof (BITMAPFILEHEADER);

The result is always 16. However, it should be 14. No matter what data
alignment (Byte, Word, Double Word or Quad Word) is setting and the result
reminder the same. I also had try the directives ¨#pragma〃 setting.
Nothing help. So I try to define a structure by myself and test it again.
What amazing, it works!! The problem is inside the HEADER file, not the
compiler. The following code paragraph sovle the problem.

#pragma pack(push, 2)

typedef struct tagBITMAPFILEHEADER2 { WORD bfType; DWORD bfSize;
WORD bfReserved1; WORD bfReserved2; DWORD bfOffBits; }
BITMAPFILEHEADER2, *PBITMAPFILEHEADER2; #pragma pack(pop)

int n = sizeof(BITMAPFILEHEADER2);

However, there are too much structures defined. I could not do such a stupid
thing to wrap all structures. Is anyone have non-upgrade version could test
it?


Sincerely,

Bell

R. Tulloch

unread,
Mar 29, 2002, 7:52:51 AM3/29/02
to
> I found a serious bug in Borland C++ Builder 6 Enterpise upgrade with
> Update Pack 1 was installed. You could try the following line.

How can there be an update pack 1. I thought BCB6 just came out??

Alisdair Meredith

unread,
Mar 29, 2002, 7:44:21 AM3/29/02
to
"R. Tulloch" wrote:

> How can there be an update pack 1. I thought BCB6 just came out??

I think he means a new license version, rather than a BCB5->6 upgrade.

Of course, I could be wrong as well :¬ )

--
AlisdairM
Team Mongolian Wok

Jeroen ter Hofstede

unread,
Mar 29, 2002, 8:09:55 AM3/29/02
to
Yes, there is an update, which AFAIK mainly fixes some Delphi problems (?!).

For the problem mentioned, see the thread "bcb6, #pragma pop ... alignment
bug".

Jeroen.

"Alisdair Meredith"
<alisdair.no.spam.please.we're.britis...@uk.renaultf1.com> wrote in
message news:3CA461A5...@uk.renaultf1.com...


> "R. Tulloch" wrote:
>
> > How can there be an update pack 1. I thought BCB6 just came out??
>
> I think he means a new license version, rather than a BCB5->6 upgrade.
>

> Of course, I could be wrong as well :Ź )

Edward Diener

unread,
Mar 29, 2002, 10:35:03 AM3/29/02
to
It's a known bug in BCB6 discussed on this newsgroup first by Alex
Bakaev. Of course Borland has not mentioned it anywhere even though they
know about it and are supposedly working on a fix.

Edit your pshpack*.h and poppack.h header files and remove the enclosing
#pragmas. Then re-make your project.

I made a point of saying in another post about this that Borland should
notify BCB6 programmers about this bug or else many others will run into
it unawares as you have done. Your post is an example of what I was
talking about.

Remy Lebeau [TeamB]

unread,
Mar 29, 2002, 12:59:15 PM3/29/02
to
It's a known bug in the pshpack1.h, pshpack2.h, pshpack4.h, pshpack8.h, and
poppack.h header files, where there's an extra set of pragma statements in
every file that screwing everything up. You need to remove the extra pragma
statements at the very top and very bottom of every file.

Why they were added to begin with, and how they made it through the testing
phases without detection, noone knows.


Gambit

"Cheng-Yuan Bell Hsu" <be...@ebmtech.com> wrote in message
news:3ca44f1c_1@dnews...

0 new messages