[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: implicit decl in tests/get-mb-cur-max.c
From: |
Jim Meyering |
Subject: |
Re: implicit decl in tests/get-mb-cur-max.c |
Date: |
Tue, 30 Mar 2010 08:11:14 +0200 |
Mike Frysinger wrote:
> minor issue:
> tests/get-mb-cur-max.c:28: warning: implicit declaration of function
> 'set_program_name'
Thanks.
This fixes it and ensures it won't happen again:
>From e317eee8217401eb14f386e5778a981aa39d6a9a Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 30 Mar 2010 08:10:31 +0200
Subject: [PATCH] build: avoid compiler warning when building test program
* tests/Makefile.am (AM_CPPFLAGS, AM_CFLAGS, AM_LDFLAGS): Define,
so that all the usual C compile-and-link machinery comes into play.
* tests/get-mb-cur-max.c: Include "progname.h".
Remove unnecessary inclusion of <ctype.h>.
Mike Frysinger reported the "implicit decl of set_program_name" warning.
---
tests/Makefile.am | 5 +++++
tests/get-mb-cur-max.c | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 81a10b5..71f47c3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,6 +15,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
check_PROGRAMS = get-mb-cur-max
+AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+
+# Tell the linker to omit references to unused shared libraries.
+AM_LDFLAGS = $(IGNORE_UNUSED_LIBRARIES_CFLAGS)
LDADD = ../lib/libgreputils.a $(LIBINTL) ../lib/libgreputils.a
TESTS = \
diff --git a/tests/get-mb-cur-max.c b/tests/get-mb-cur-max.c
index f7384d5..3ba7389 100644
--- a/tests/get-mb-cur-max.c
+++ b/tests/get-mb-cur-max.c
@@ -18,12 +18,13 @@
#include <config.h>
#include <locale.h>
-#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
+#include "progname.h"
+
int
-main(int argc, char **argv)
+main (int argc, char **argv)
{
set_program_name (argv[0]);
if (setlocale (LC_ALL, argv[1]))
--
1.7.0.3.513.gc8ed0