This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getopt.h getopt() decl broken for many targets


Hi Aaron,

Targets, such as Windows, that don't have getopt() will probably have
get the following error when compiling binutils.

/aaronwl/cs/compilers/binutils/src/cvs/src/binutils/../include/getopt.h:116:
warning: function declaration isn't a prototype

Is the situation described in this comment still true?  Would it be
possible to turn this whitelist into a blacklist?

If your build-time environment does provide a prototype for getopt() which is compatible with the one in include/getopt.h then you may find that the attached two patches help. The first one fixes the configure system in the binutils/ subdirectory so that it checks for a working getopt() prototype. (You will need to regenerate the configure files after applying the patch). The second patch fixes the sources for addr2line.c so that the config.h file is included before bfd.h so that it can pick up the definition of HAVE_DECL_GETOPT which should now be in config.h.


Note - this issue is being discussed on a thread on the bug-binutils@gnu.org mailing list started by Vladimir Merzliakov. Unfortunately it appears that this list is not being archived at the moment so I cannot give you a URL to follow.

Cheers
  Nick


Index: binutils/addr2line.c
===================================================================
RCS file: /cvs/src/src/binutils/addr2line.c,v
retrieving revision 1.21
diff -c -3 -p -r1.21 addr2line.c
*** binutils/addr2line.c	15 Jun 2004 01:19:13 -0000	1.21
--- binutils/addr2line.c	29 Mar 2005 15:33:56 -0000
***************
*** 29,34 ****
--- 29,35 ----
     both forms write results to stdout, the second form reads addresses
     to be converted from stdin.  */
  
+ #include "config.h"
  #include <string.h>
  
  #include "bfd.h"

Attachment: binutils.config.patch.supplimental.bz2
Description: BZip2 compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]