Why does bfd/trad-core.c include <sys/dir.h>?

Ian Lance Taylor ian@zembu.com
Thu Apr 20 10:32:00 GMT 2000


   Date: Thu, 20 Apr 2000 16:47:41 +1000
   From: Andrew Cagney <ac131313@cygnus.com>

   bfd/trad-core.c includes <sys/dir.h> (unconditionally).  My Solaris
   2.5.1 machine tells me:

   /usr/include/sys/dir.h:41: warning: #warning "The information in this
   file should be obtained from <dirent.h>"
   /usr/include/sys/dir.h:42: warning: #warning "and is provided solely
   (and temporarily) for backward compatibility."

   what really puzzles me is that I can't see any obvious <dirent.h>
   dependant code in the file.

I believe that on some systems you must include <sys/dir.h> before
including <sys/user.h>.  I'm not completly certain about that, though.

In any case, the fix is straightforward.  Copy the HAVE_DIRENT_H
handling from hpux-core.c.

Ian


More information about the Binutils mailing list