findutils-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Findutils-patches] Avoid link failure with gcc -fno-common.


From: Jim Meyering
Subject: [Findutils-patches] Avoid link failure with gcc -fno-common.
Date: Sat, 08 Mar 2008 23:32:43 +0100

Without the following patch, gcc -fno-common fails like this:

./libfindtools.a(finddata.o):(.bss+0xb0): multiple definition of `starting_desc'
find.o:(.bss+0x0): first defined here
./libfindtools.a(finddata.o):(.bss+0xb8): multiple definition of `program_name'
find.o:(.bss+0x8): first defined here


        Avoid link failure with gcc -fno-common.
        * find.c (program_name, starting_desc): Declare "extern".

Signed-off-by: Jim Meyering <address@hidden>
---
 find/find.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/find/find.c b/find/find.c
index c6dad7c..66ee07e 100644
--- a/find/find.c
+++ b/find/find.c
@@ -84,12 +84,12 @@ static void process_dir PARAMS((char *pathname, char *name, 
int pathlen, const s


 /* Name this program was run with. */
-char *program_name;
+extern char *program_name;

 /* A file descriptor open to the initial working directory.
    Doing it this way allows us to work when the i.w.d. has
    unreadable parents.  */
-int starting_desc;
+extern int starting_desc;

 /* The stat buffer of the initial working directory. */
 static struct stat starting_stat_buf;
--
1.5.4.3.485.g2b05




reply via email to

[Prev in Thread] Current Thread [Next in Thread]