[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#23640: 25.1.50; Getting rid of compiler warnings
From: |
Ken Brown |
Subject: |
bug#23640: 25.1.50; Getting rid of compiler warnings |
Date: |
Mon, 30 May 2016 12:20:24 -0400 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 |
On 5/30/2016 10:41 AM, Ken Brown wrote:
> Question: Why bother with IF_LINT at all? Why not just unconditionally
> initialize the variables that gcc complains about?
If keeping IF_LINT is important, we could do something like this:
diff --git a/configure.ac b/configure.ac
index e88a3a9..f628c9a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -997,7 +997,14 @@ AC_DEFUN
gl_WARN_ADD([-Wno-pointer-sign])
fi
- AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
+ case $opsys in
+ cygwin | freebsd)
+ AC_DEFINE([gcc_warnings], [1], [Define to 1 if gcc warnings are enabled.])
+ ;;
+ *)
+ AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
+ ;;
+ esac
AC_DEFINE([GNULIB_PORTCHECK], [1], [enable some gnulib portability checks])
AH_VERBATIM([GNULIB_PORTCHECK_FORTIFY_SOURCE],
[/* Enable compile-time and run-time bounds-checking, and some warnings,
diff --git a/src/conf_post.h b/src/conf_post.h
index 5d3394f..987bcad 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -344,7 +344,7 @@ extern int emacs_setenv_TZ (char const *);
#endif
/* Use this to suppress gcc's `...may be used before initialized' warnings. */
-#ifdef lint
+#if defined lint || defined gcc_warnings
/* Use CODE only if lint checking is in effect. */
# define IF_LINT(Code) Code
#else
- bug#23640: 25.1.50; Getting rid of compiler warnings, Ken Brown, 2016/05/28
- bug#23640: 25.1.50; Getting rid of compiler warnings, Eli Zaretskii, 2016/05/28
- bug#23640: 25.1.50; Getting rid of compiler warnings, Ken Brown, 2016/05/28
- bug#23640: 25.1.50; Getting rid of compiler warnings, Ken Brown, 2016/05/29
- bug#23640: 25.1.50; Getting rid of compiler warnings, Ken Brown, 2016/05/30
- bug#23640: 25.1.50; Getting rid of compiler warnings, Ken Brown, 2016/05/30
- bug#23640: 25.1.50; Getting rid of compiler warnings,
Ken Brown <=
- bug#23640: 25.1.50; Getting rid of compiler warnings, Paul Eggert, 2016/05/30
- bug#23640: 25.1.50; Getting rid of compiler warnings, Ken Brown, 2016/05/30
- bug#23640: 25.1.50; Getting rid of compiler warnings, Andy Moreton, 2016/05/31
- bug#23640: 25.1.50; Getting rid of compiler warnings, Richard Stallman, 2016/05/31
- bug#23640: 25.1.50; Getting rid of compiler warnings, Paul Eggert, 2016/05/30