From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MPS symbols Date: Fri, 28 Jun 2024 20:40:13 +0300 Message-ID: <86tthdj79e.fsf@gnu.org> References: <87r0chwnzx.fsf@gmail.com> <87ikxtwljl.fsf@gmail.com> <86cyo148rq.fsf@gnu.org> <8734oxw55g.fsf@gmail.com> <87wmm9ulah.fsf@gmail.com> <86v81tjbl4.fsf@gnu.org> <87jzi9ujjo.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19337"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 28 19:41:26 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sNFbB-0004oc-Os for ged-emacs-devel@m.gmane-mx.org; Fri, 28 Jun 2024 19:41:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNFaF-0004Tq-A6; Fri, 28 Jun 2024 13:40:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNFa7-0004Tb-Nz for emacs-devel@gnu.org; Fri, 28 Jun 2024 13:40:19 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNFa7-0001LM-BM; Fri, 28 Jun 2024 13:40:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=h8Ibjc4+YTBtsxrp0P0EVPji4FJ1WkRKycAAHxYIONE=; b=TvuUxxKiAexk BWC+xqeoi4BYoWzljhPD8q8unIb6LbQ8VutU6uYitnGWE6/4XoEklLicumq/JP82OSTur1DW/4OsY jURfMbEDm2Wyj4zyBgFN5PxlrKFGR2Jy+XJammj4ra1Q6YDjjWeHXZenLuWyWVrwVbSKbKrx7Uos8 4uEGfltuvWADu40vivG1IsQu4vCSIn5TtgJ0Q2AOhGYqOtkTQ6deLxjcjMNMsw5OjnxqAEeKnFv+V 4ps7NcfnYSL4i11W9zs3ryoWW81FRofEncUh2d5tZvYDADrb+myjG46WcRxYuI1V3q3ODsdoOpsl0 hm2sgG47oM3/L41Zv8jS5Q==; In-Reply-To: <87jzi9ujjo.fsf@gmail.com> (message from Helmut Eller on Fri, 28 Jun 2024 18:19:23 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320829 Archived-At: > From: Helmut Eller > Cc: gerd.moellmann@gmail.com, emacs-devel@gnu.org > Date: Fri, 28 Jun 2024 18:19:23 +0200 > > On Fri, Jun 28 2024, Eli Zaretskii wrote: > > >> -extern EMACS_INT pure[]; > >> +extern EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) > >> + / sizeof (EMACS_INT)]; > > > > I don't understand why you moved the definition of puresize[] from > > alloc.c to puresize.h. If we need the same definition in two source > > files, and you don't want to repeat it more than once, just do the > > arithmetics in puresize.h and leave the definition simple, like this: > > > > EMACS_INT pure[pure_size]; > > > > where pure_size is computed in puresize.h. > > > > Having dimension in an extern declaration in a header file is at least > > unusual, if not unportable. > > I guess it's a matter of taste. If the array type includes the length, > then the compiler knows the size and sizeof(pure) works. That's all. The dimension is part of the definition, not of the declaration. You rely on the linker to supply the dimension, but that's not how things are done in C.