| delorie.com/archives/browse.cgi | search | 
| Newsgroups: | comp.os.msdos.djgpp | 
| From: | paasen <paasen AT natlab DOT research DOT philips DOT com> | 
| 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 | 
| 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 <here is the ffblk structure stuff> #ifdef __cplusplus #pragma pack() #endif The same may be needed around the time structrure in dos.h ? .
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |