diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-06-24 06:59:36 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2009-06-24 06:59:36 +0000 |
commit | f9ae44a71cae5ec08a0cda563aee32c4d3bdac44 (patch) | |
tree | 1438a9cab276d3bd5793e6d9c9c02dabc795586b | |
parent | 4f786b174a80e918e46366d092f152e1ef6d1ee6 (diff) |
enable compiler warnings
git-svn-id: svn://tug.org/texlive/trunk@13935 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/utils/psutils/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/utils/psutils/Makefile.am | 3 | ||||
-rw-r--r-- | Build/source/utils/psutils/Makefile.in | 6 | ||||
-rw-r--r-- | Build/source/utils/psutils/aclocal.m4 | 1 | ||||
-rwxr-xr-x | Build/source/utils/psutils/configure | 62 | ||||
-rw-r--r-- | Build/source/utils/psutils/configure.ac | 3 | ||||
-rw-r--r-- | Build/source/utils/psutils/epsffit.c | 2 | ||||
-rw-r--r-- | Build/source/utils/psutils/psnup.c | 5 | ||||
-rw-r--r-- | Build/source/utils/psutils/pstops.c | 2 |
9 files changed, 86 insertions, 5 deletions
diff --git a/Build/source/utils/psutils/ChangeLog b/Build/source/utils/psutils/ChangeLog index f5f4d0ec71f..61ef94b9462 100644 --- a/Build/source/utils/psutils/ChangeLog +++ b/Build/source/utils/psutils/ChangeLog @@ -1,3 +1,10 @@ +2009-06-23 Peter Breitenlohner <peb@mppmu.mpg.de> + + * Makefile.am (AM_CFLAGS), configure.ac: enable compiler warnings. + * epsffit.c (main): avoid uninitialized warnings. + * psnup.c (main): avoid uninitialized warnings. + * pstops.c (void): declare as static. + 2009-05-06 Peter Breitenlohner <peb@mppmu.mpg.de> Adapt to TL2009 build system. diff --git a/Build/source/utils/psutils/Makefile.am b/Build/source/utils/psutils/Makefile.am index 366de6cbb1f..27c7f57d06a 100644 --- a/Build/source/utils/psutils/Makefile.am +++ b/Build/source/utils/psutils/Makefile.am @@ -3,10 +3,13 @@ ## Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org> ## You may freely use, modify and/or distribute this file. ## +ACLOCAL_AMFLAGS = -I ../../m4 + OS = UNIX PAPER = a4 AM_CPPFLAGS = -DUNIX -DPAPER=\"$(PAPER)\" +AM_CFLAGS = $(WARNING_CFLAGS) bin_PROGRAMS = epsffit psbook psnup psresize psselect pstops diff --git a/Build/source/utils/psutils/Makefile.in b/Build/source/utils/psutils/Makefile.in index c465d7fafe3..54e46921d0a 100644 --- a/Build/source/utils/psutils/Makefile.in +++ b/Build/source/utils/psutils/Makefile.in @@ -48,7 +48,8 @@ DIST_COMMON = README $(am__configure_deps) $(dist_man1_MANS) \ ../../build-aux/missing ../../build-aux/mkinstalldirs \ ../../build-aux/texinfo.tex ../../build-aux/ylwrap ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/../../m4/kpse-warnings.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -173,6 +174,7 @@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +WARNING_CFLAGS = @WARNING_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -215,9 +217,11 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +ACLOCAL_AMFLAGS = -I ../../m4 OS = UNIX PAPER = a4 AM_CPPFLAGS = -DUNIX -DPAPER=\"$(PAPER)\" +AM_CFLAGS = $(WARNING_CFLAGS) epsffit_SOURCES = \ config.h \ epsffit.c \ diff --git a/Build/source/utils/psutils/aclocal.m4 b/Build/source/utils/psutils/aclocal.m4 index d360465f230..a6397fb2452 100644 --- a/Build/source/utils/psutils/aclocal.m4 +++ b/Build/source/utils/psutils/aclocal.m4 @@ -989,3 +989,4 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([../../m4/kpse-warnings.m4]) diff --git a/Build/source/utils/psutils/configure b/Build/source/utils/psutils/configure index b2195cee513..2af9e9267b1 100755 --- a/Build/source/utils/psutils/configure +++ b/Build/source/utils/psutils/configure @@ -605,6 +605,7 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +WARNING_CFLAGS am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -689,6 +690,7 @@ ac_user_opts=' enable_option_checking enable_maintainer_mode enable_dependency_tracking +enable_compiler_warnings ' ac_precious_vars='build_alias host_alias @@ -1329,6 +1331,9 @@ Optional Features: (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors + --enable-compiler-warnings=[no|min|yes|max] + Turn on compiler warnings [default: yes if + maintainer-mode, min otherwise] Some influential environment variables: CC C compiler command @@ -1821,6 +1826,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + am__api_version='1.11' # Find a good install program. We prefer a C program (faster), @@ -3458,6 +3464,62 @@ fi +# Check whether --enable-compiler-warnings was given. +if test "${enable_compiler_warnings+set}" = set; then + enableval=$enable_compiler_warnings; +fi +case $enable_compiler_warnings in + no | min | yes | max) : ;; + *) if test "x$enable_maintainer_mode" = xyes; then + enable_compiler_warnings=yes +else + enable_compiler_warnings=min +fi + ;; +esac + + +{ $as_echo "$as_me:$LINENO: checking what warning flags to pass to the C compiler" >&5 +$as_echo_n "checking what warning flags to pass to the C compiler... " >&6; } +if test "${kpse_cv_warning_cflags+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test "x$enable_compiler_warnings" = xno; then + kpse_cv_warning_cflags= +elif test "x$GCC" = xyes; then + kpse_cv_warning_cflags="-Wall -Wunused" + case `$CC -dumpversion` in + 3.4.* | 4.*) kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wdeclaration-after-statement" ;; +esac + + case `$CC -dumpversion` in + 3.[234].* | 4.*) kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wno-unknown-pragmas" ;; +esac + + if test "x$enable_compiler_warnings" != xmin; then + kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wmissing-prototypes -Wmissing-declarations" + if test "x$enable_compiler_warnings" != xyes; then + kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wimplicit -Wparentheses -Wreturn-type" + kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wswitch -Wtrigraphs -Wshadow -Wpointer-arith" + kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wcast-qual -Wcast-align -Wwrite-strings" + case `$CC -dumpversion` in + 3.4.* | 4.*) kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wold-style-definition" ;; +esac + + fi + fi +else + : # FIXME: warning flags for non-gcc compilers +fi +fi +{ $as_echo "$as_me:$LINENO: result: $kpse_cv_warning_cflags" >&5 +$as_echo "$kpse_cv_warning_cflags" >&6; } +WARNING_CFLAGS=$kpse_cv_warning_cflags + + + + + ac_config_files="$ac_config_files Makefile patchlev.h" diff --git a/Build/source/utils/psutils/configure.ac b/Build/source/utils/psutils/configure.ac index 2f08435c19a..27069acfbb7 100644 --- a/Build/source/utils/psutils/configure.ac +++ b/Build/source/utils/psutils/configure.ac @@ -10,12 +10,15 @@ AC_INIT([psutils for TeX Live], [1.17], [tex-k@tug.org]) AC_PREREQ([2.63]) AC_CONFIG_SRCDIR([psutil.c]) AC_CONFIG_AUX_DIR([../../build-aux]) +AC_CONFIG_MACRO_DIR([../../m4]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE AC_PROG_CC +KPSE_COMPILER_WARNINGS + AC_CONFIG_FILES([Makefile patchlev.h]) AC_OUTPUT diff --git a/Build/source/utils/psutils/epsffit.c b/Build/source/utils/psutils/epsffit.c index 25ccfd65812..908c2366a95 100644 --- a/Build/source/utils/psutils/epsffit.c +++ b/Build/source/utils/psutils/epsffit.c @@ -43,7 +43,7 @@ static void usage(void) int main(int argc, char **argv) { int bbfound = 0; /* %%BoundingBox: found */ - int urx, ury, llx, lly; + int urx = 0, ury = 0, llx = 0, lly = 0; /* avoid uninitialized warning */ int furx, fury, fllx, flly; int showpage = 0, centre = 0, rotate = 0, aspect = 0, maximise = 0; char buf[BUFSIZ]; diff --git a/Build/source/utils/psutils/psnup.c b/Build/source/utils/psutils/psnup.c index 86865ee47ad..1a39e95c418 100644 --- a/Build/source/utils/psutils/psnup.c +++ b/Build/source/utils/psutils/psnup.c @@ -68,10 +68,11 @@ static int nextdiv(int n, int m) int main(int argc, char *argv[]) { - int horiz, vert, rotate, column, flip, leftright, topbottom; + int horiz = 0, vert = 0, rotate = 0; /* avoid uninitialized warning */ + int column, flip, leftright, topbottom; int nup = 1; double draw = 0; /* draw page borders */ - double scale; /* page scale */ + double scale = 0; /* page scale */ double uscale = 0; /* user supplied scale */ double ppwid, pphgt; /* paper dimensions */ double margin, border; /* paper & page margins */ diff --git a/Build/source/utils/psutils/pstops.c b/Build/source/utils/psutils/pstops.c index bb077bfa6d8..02632c1e74d 100644 --- a/Build/source/utils/psutils/pstops.c +++ b/Build/source/utils/psutils/pstops.c @@ -21,7 +21,7 @@ FILE *outfile ; char pagelabel[BUFSIZ] ; int pageno ; -void usage(void) +static void usage(void) { fprintf(stderr, "%s release %d patchlevel %d\n", program, RELEASE, PATCHLEVEL); fprintf(stderr, "Copyright (C) Angus J. C. Duggan, 1991-1995. See file LICENSE for details.\n"); |