This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
[rfa] Include <dirent.h> et al; Was: Why does bfd/trad-core.c include <sys/dir.h>?
- To: binutils at sourceware dot cygnus dot com
- Subject: [rfa] Include <dirent.h> et al; Was: Why does bfd/trad-core.c include <sys/dir.h>?
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Tue, 30 May 2000 16:14:52 +1000
- Organization: Cygnus Solutions
- References: <38FEA80D.4629EDDA@cygnus.com> <20000420165256.17252.qmail@daffy.airs.com>
Ian Lance Taylor wrote:
>
> 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.
Patch attached. Ok?
Andrew
Tue May 30 15:39:04 2000 Andrew Cagney <cagney@b1.cygnus.com>
* trad-core.c: From hpux-core.c, include <dirent.h> or
<sys/ndir.h> when possible.
Index: bfd/trad-core.c
===================================================================
RCS file: /cvs/src/src/bfd/trad-core.c,v
retrieving revision 1.6
diff -p -r1.6 trad-core.c
*** trad-core.c 2000/05/08 06:57:39 1.6
--- trad-core.c 2000/05/30 06:12:41
*************** Foundation, Inc., 59 Temple Place - Suit
*** 25,31 ****
#include "libaout.h" /* BFD a.out internal data structures */
#include <sys/param.h>
! #include <sys/dir.h>
#include <signal.h>
#include <sys/user.h> /* After a.out.h */
--- 25,43 ----
#include "libaout.h" /* BFD a.out internal data structures */
#include <sys/param.h>
! #ifdef HAVE_DIRENT_H
! # include <dirent.h>
! #else
! # ifdef HAVE_SYS_NDIR_H
! # include <sys/ndir.h>
! # endif
! # ifdef HAVE_SYS_DIR_H
! # include <sys/dir.h>
! # endif
! # ifdef HAVE_NDIR_H
! # include <ndir.h>
! # endif
! #endif
#include <signal.h>
#include <sys/user.h> /* After a.out.h */