unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 23640@debbugs.gnu.org, Paul Eggert <eggert@cs.ucla.edu>,
	Andy Moreton <andrewjmoreton@gmail.com>
Subject: bug#23640: 25.1.50; Getting rid of compiler warnings
Date: Mon, 30 May 2016 12:20:24 -0400	[thread overview]
Message-ID: <0ff3a5dd-91e3-f455-0b17-88e6ba2c6802@cornell.edu> (raw)
In-Reply-To: <b5f88f09-1413-8853-bb41-a5ee3d00d810@cornell.edu>

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







  reply	other threads:[~2016-05-30 16:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-28 18:40 bug#23640: 25.1.50; Getting rid of compiler warnings Ken Brown
2016-05-28 18:57 ` Eli Zaretskii
2016-05-28 21:47   ` Ken Brown
2016-05-29 22:43     ` Ken Brown
2016-05-30 11:39       ` Ken Brown
2016-05-30 14:41         ` Ken Brown
2016-05-30 16:20           ` Ken Brown [this message]
2016-05-30 23:29           ` Paul Eggert
2016-05-31  0:11             ` Ken Brown
2016-05-31  8:03             ` Andy Moreton
2016-05-31 22:22               ` Richard Stallman
2016-05-31  0:15           ` Paul Eggert
2016-06-01  8:35 ` Paul Eggert
2016-06-01 20:37   ` Richard Stallman
2016-06-01 21:10     ` Paul Eggert
2016-06-02 12:05       ` Andy Moreton
2016-06-03  3:35       ` Richard Stallman
2016-06-06 14:45         ` Paul Eggert
2016-06-07  6:19           ` Richard Stallman
2016-06-07  7:15             ` Paul Eggert
2016-06-08  4:00               ` Richard Stallman
2016-06-08  7:18                 ` Paul Eggert
2016-06-08 17:06                   ` Richard Stallman
2016-06-01  8:55 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ff3a5dd-91e3-f455-0b17-88e6ba2c6802@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=23640@debbugs.gnu.org \
    --cc=andrewjmoreton@gmail.com \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).