[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] frcode: avoid link failure due to multiple program_name definiti
From: |
Jim Meyering |
Subject: |
[PATCH] frcode: avoid link failure due to multiple program_name definitions |
Date: |
Mon, 05 Apr 2010 14:20:27 +0200 |
Hello,
I tried to build from git and got this:
frcode.c: In function 'main':
frcode.c:226: warning: implicit declaration of function 'set_program_name'
mv -f .deps/frcode.Tpo .deps/frcode.Po
gcc -std=gnu99 -Wdeclaration-after-statement -Wall -Wall -Wshadow
-Wformat-security -Winit-self -fno-common -Dlint -O3 -DGNULIB_PORTCHECK
-falign-loops=2 -falign-jumps=2 -falign-functions=2 -fomit-frame-pointer -Wall
-Wshadow -Wformat-security -Winit-self -s -o frcode frcode.o
../lib/libfind.a ../gnulib/lib/libgnulib.a
../gnulib/lib/libgnulib.a(progname.o):(.bss+0x0): multiple definition of
`program_name'
frcode.o:(.bss+0x0): first defined here
collect2: ld returned 1 exit status
make[4]: *** [frcode] Error 1
Doing the following solved it for me:
>From 5c771a65a3739395011d1ecfcc84778fd87b1635 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 5 Apr 2010 14:10:26 +0200
Subject: [PATCH] frcode: avoid link failure due to multiple program_name
definitions
* locate/frcode.c: Include "progname.h".
(program_name): Remove two declarations.
Now the definition comes from gnulib.
---
ChangeLog | 7 +++++++
locate/frcode.c | 8 +-------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 709235a..ae1ff04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-04-05 Jim Meyering <address@hidden>
+
+ frcode: avoid link failure due to multiple program_name definition
+ * locate/frcode.c: Include "progname.h".
+ (program_name): Remove two declarations.
+ Now the definition comes from gnulib.
+
2010-04-04 James Youngman <address@hidden>
Fix Savannah bug #29435: fd_is_cloexec does not work on Fedora
diff --git a/locate/frcode.c b/locate/frcode.c
index 85f5619..0e144d5 100644
--- a/locate/frcode.c
+++ b/locate/frcode.c
@@ -102,12 +102,10 @@
#include "error.h"
#include "closeout.h"
#include "findutils-version.h"
+#include "progname.h"
char *xmalloc PARAMS((size_t));
-/* The name this program was run with. */
-char *program_name;
-
/* Write out a 16-bit int, high byte first (network byte order).
* Return true iff all went well.
*/
@@ -151,10 +149,6 @@ static struct option const longopts[] =
extern char *version_string;
-/* The name this program was run with. */
-char *program_name;
-
-
static void
usage (FILE *stream)
{
--
1.7.0.4.552.gc303
- [PATCH] frcode: avoid link failure due to multiple program_name definitions,
Jim Meyering <=