Newsgroups: comp.os.msdos.djgpp From: paasen Subject: Re: findfirst() findnext() bug? Sender: news AT natlab DOT research DOT philips DOT com (USENET News System) Message-ID: <324F7FBD.41C67EA6@natlab.research.philips.com> Date: Mon, 30 Sep 1996 08:07:25 GMT Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii References: <324F4DE9 DOT 70FC AT stud DOT tue DOT nl> Mime-Version: 1.0 Organization: Philips Research Laboratories Lines: 26 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Richard L.F. van Paasen wrote: > > Hi, > > When I use the findfirst() and findnext() functions of libc, > the first 2 characters of the names in ffblk.ff_name dissapear. > Is this a bug in libc.a ? With Borland C, this works fine. > I found that it is a bug in the gcc C++ compiler. The compiler doesn't pack the structures that have the __attribute__((packed)) keywords. A work around for this is to add the following in dir.h: #ifdef __cplusplus #pragma pack(1) #endif #ifdef __cplusplus #pragma pack() #endif The same may be needed around the time structrure in dos.h ? .