From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#11935: XINT etc. should be functions Date: Mon, 16 Jul 2012 15:46:31 -0700 Organization: UCLA Computer Science Department Message-ID: <500499C7.20902@cs.ucla.edu> References: <500039B7.8050106@cs.ucla.edu> <5002C895.4080400@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1342478837 16354 80.91.229.3 (16 Jul 2012 22:47:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Jul 2012 22:47:17 +0000 (UTC) Cc: 11935@debbugs.gnu.org To: rms@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 17 00:47:16 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Squ4M-00026v-RS for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Jul 2012 00:47:11 +0200 Original-Received: from localhost ([::1]:48005 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Squ4L-0005i5-V7 for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Jul 2012 18:47:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Squ4J-0005hy-Lm for bug-gnu-emacs@gnu.org; Mon, 16 Jul 2012 18:47:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Squ4I-0002Fi-Kh for bug-gnu-emacs@gnu.org; Mon, 16 Jul 2012 18:47:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Squ4I-0002Fe-H6 for bug-gnu-emacs@gnu.org; Mon, 16 Jul 2012 18:47:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SquA2-0008JT-Pt for bug-gnu-emacs@gnu.org; Mon, 16 Jul 2012 18:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Jul 2012 22:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11935 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 11935-submit@debbugs.gnu.org id=B11935.134247915431920 (code B ref 11935); Mon, 16 Jul 2012 22:53:02 +0000 Original-Received: (at 11935) by debbugs.gnu.org; 16 Jul 2012 22:52:34 +0000 Original-Received: from localhost ([127.0.0.1]:44776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Squ9Z-0008In-Rd for submit@debbugs.gnu.org; Mon, 16 Jul 2012 18:52:34 -0400 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:43563) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Squ9V-0008Id-Du for 11935@debbugs.gnu.org; Mon, 16 Jul 2012 18:52:31 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 059AD39E800B; Mon, 16 Jul 2012 15:46:32 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PDrgVHwHMyDU; Mon, 16 Jul 2012 15:46:30 -0700 (PDT) Original-Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net [108.23.119.2]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B69E939E8008; Mon, 16 Jul 2012 15:46:30 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:62009 Archived-At: On 07/16/2012 11:19 AM, Richard Stallman wrote: > Please set them up to always inline. There can be > a macro switch to turn that off with -D. Sure, that's easy. I plan to incorporate something like the patch below, which uses -DINLINING=0 to turn it off (default is INLINING=1). === modified file 'ChangeLog' --- ChangeLog 2012-07-16 06:49:45 +0000 +++ ChangeLog 2012-07-16 22:35:32 +0000 @@ -3,6 +3,9 @@ Use functions, not macros, for XINT etc. * configure.ac (WARN_CFLAGS): Remove -Wbad-function-cast, as it generates bogus warnings about reasonable casts of calls. + (ALWAYS_INLINE): New macro. + (inline): Define to 'ALWAYS_INLINE' when compiling with GCC without + optimization, and without -DINLINING=0. 2012-07-15 Paul Eggert === modified file 'configure.ac' --- configure.ac 2012-07-15 00:33:12 +0000 +++ configure.ac 2012-07-16 22:21:37 +0000 @@ -4238,6 +4238,25 @@ #include #include +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) +# define ALWAYS_INLINE __attribute__ ((__always_inline__)) +#else +# define ALWAYS_INLINE +#endif + +/* When compiling via GCC without optimization, and without -DINLINING=0, + always inline functions marked 'inline'. This typically improves CPU + performance when debugging. With optimization, trust the compiler + to inline as appropriate. */ +#ifndef INLINING +# define INLINING 1 +#endif +#if (defined __NO_INLINE__ \ + && ! defined __OPTIMIZE__ && ! defined __OPTIMIZE_SIZE__ \ + && INLINING && !defined inline) +# define inline ALWAYS_INLINE +#endif + #if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */ #define NO_INLINE __attribute__((noinline)) #else