From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: inlinable functions instead of macros Date: Fri, 24 Aug 2012 22:05:16 -0400 Message-ID: References: <502EDAF3.6030005@cs.ucla.edu> <5034A654.2080909@cs.ucla.edu> <5037F411.4010905@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1345860330 4265 80.91.229.3 (25 Aug 2012 02:05:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Aug 2012 02:05:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 25 04:05:30 2012 Return-path: Envelope-to: ged-emacs-devel@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 1T55kf-0008Tr-IL for ged-emacs-devel@m.gmane.org; Sat, 25 Aug 2012 04:05:29 +0200 Original-Received: from localhost ([::1]:32869 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T55kd-0007Mx-NY for ged-emacs-devel@m.gmane.org; Fri, 24 Aug 2012 22:05:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T55kX-0007Mk-Uy for emacs-devel@gnu.org; Fri, 24 Aug 2012 22:05:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T55kT-0004Xx-No for emacs-devel@gnu.org; Fri, 24 Aug 2012 22:05:21 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:25385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T55kT-0004Xk-Jb for emacs-devel@gnu.org; Fri, 24 Aug 2012 22:05:17 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu0/O+KG6/2dsb2JhbABEDrQDgQiCFQEBBAFWIwULCzQSFBgNJIgcBboJkEQDozOBWIIwVYE6Gg X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="196651609" Original-Received: from 206-248-161-186.dsl.teksavvy.com (HELO pastel.home) ([206.248.161.186]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 24 Aug 2012 22:05:16 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 8B34358914; Fri, 24 Aug 2012 22:05:16 -0400 (EDT) In-Reply-To: <5037F411.4010905@cs.ucla.edu> (Paul Eggert's message of "Fri, 24 Aug 2012 14:37:21 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152823 Archived-At: > problems that make the macros hard to use. They cannot be invoked > from GDB, which complicates debugging. More important, callers Most of those macros don't need to be used from GDB (e.g. I've never needed to use ASET from GDB). > restriction makes callers error-prone. We've tried to address some of > the side-effect issues with this hack: > /* The IDX==IDX tries to detect when the macro argument is side-effecting. */ > #define ASET(ARRAY, IDX, VAL) \ > (eassert ((IDX) == (IDX)), \ This should be removed indeed. I added it temporarily and in any case it doesn't work (e.g. "i++ == i++" will always return true in my experience). > + Reimplement in terms of eassert_f, blv_found_f, set_blv_found_f. > + (eassert_f, blv_found_f, set_blv_found_f): New macros or functions, > + containing the guts of the old, but which let the caller specify > + file and line number. I'd rather avoid these kinds of efforts, Stefan