[patch] chew.c: Don't include sysdep.h.

Kazu Hirata kazu@codesourcery.com
Fri Jul 22 14:08:00 GMT 2005


Hi,

Attached is a patch to have chew.c not include sysdep.h.

Currently, chew.c includes sysdep.h, which in turn includes config.h,
but config.h is for the host system, not the build system.

When the build and host systems are i686-pc-linux-gnu and
i686-mingw32, respectively, this confusion leads to a build failure
like so:

.../bfd/doc/chew.c:86:
.../bfd/doc/../sysdep.h:134: error: parse error before "__extension__"

Line 134 of sysdep.h looks like

#if !HAVE_DECL_STPCPY
extern char *stpcpy (char *__dest, const char *__src);
#endif

The host system (i686-mingw32) does not have stpcpy, but the build
system (i686-pc-linux-gnu) has stpcpy as a macro.

A proper fix would probably require generating config.h for the build
system, but that would seem to be a lot of work.  Since chew.c is a
simple text processing program, I just chose not to include sysdep.h
but to trust standard headers like stdio.h.

Tested by building a native (i686-pc-linux-gnu), a cross
(i686-pc-linux-gnu X arm-none-eabi), and a canadian cross
(i686-mingw32 X arm-none-eabi built on i686-pc-linux-gnu).  OK to
apply?

Kazu Hirata

2005-07-22  Kazu Hirata  <kazu@codesourcery.com>

	* chew.c: Don't include sysdep.h.

Index: chew.c
===================================================================
RCS file: /home/gcc/repos/src/src/bfd/doc/chew.c,v
retrieving revision 1.16
diff -u -d -p -r1.16 chew.c
--- chew.c	4 May 2005 15:53:42 -0000	1.16
+++ chew.c	21 Jul 2005 17:59:56 -0000
@@ -83,7 +83,6 @@ Foundation, Inc., 51 Franklin Street - F
    Foo.  */
 
 #include "ansidecl.h"
-#include "sysdep.h"
 #include <assert.h>
 #include <stdio.h>
 #include <ctype.h>



More information about the Binutils mailing list