From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: Emacs 28 on OSX: emacsclient.c:1415: warning: implicit declaration of function 'openat' Date: Tue, 19 Apr 2022 05:19:10 +0100 Message-ID: References: <87zgkhg5qd.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3N0z0FsK5P7XusJV" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34889"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Mattias =?iso-8859-1?Q?Engdeg=E5rd?= , Keith David Bershatsky , Paul Eggert , emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 19 06:20:07 2022 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 1ngfLS-0008u3-Fd for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Apr 2022 06:20:06 +0200 Original-Received: from localhost ([::1]:52972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ngfLQ-0006Kz-Jx for ged-emacs-devel@m.gmane-mx.org; Tue, 19 Apr 2022 00:20:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngfKi-0005eo-U1 for emacs-devel@gnu.org; Tue, 19 Apr 2022 00:19:20 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:59789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngfKf-0007k7-Vn for emacs-devel@gnu.org; Tue, 19 Apr 2022 00:19:20 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 5A3BC4E; Tue, 19 Apr 2022 04:19:13 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.100]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1650341952; bh=lPnb716WujAXwlIkgwWGNEwThrCqwokYcwEt/6eADmg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TsSqlV4qFTeIdWKf1MsIsfykWSBvg44WYGCRfhz6r6bGfeNVlUfEQiJgiLFQ5Rr78 i9FT2DMXA2f7PiWxccxceVFTuNvQ13u+ojd0dUFt3YEmEnu9eBYe/GiyFyBImXrcjv EKHXK5iTUh+YXGHF859c6QBf12Q52vDPi+dxqw6FHg6Aux3CDEb91CbcGMVOIokvwg jXYzne6FCUd2Z7ytnzEsKxu/fUHCZijrTVzjBVf06erzs3DbdRFSZPavGN6bXZGlEd fXEBQX2Axap3lr9iq4Hu08r8kwyn9zWniWqOcMcBgwOUsAn5RYcKr8+7Ltvb6pvxh2 ei2Wsuqhtm2HA== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95) (envelope-from ) id 1ngfKY-000b2N-4y; Tue, 19 Apr 2022 05:19:10 +0100 Mail-Followup-To: Alan Third , Po Lu , Keith David Bershatsky , emacs-devel@gnu.org, Mattias =?iso-8859-1?Q?Engdeg=E5rd?= , Paul Eggert Content-Disposition: inline In-Reply-To: <87zgkhg5qd.fsf@yahoo.com> Received-SPF: pass client-ip=116.202.126.228; envelope-from=alan@idiocy.org; helo=outbound.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.devel:288646 Archived-At: --3N0z0FsK5P7XusJV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Apr 19, 2022 at 10:35:38AM +0800, Po Lu wrote: > Keith David Bershatsky writes: > > > I located just one instance of 1060 and changed it to 1068 per your > > suggestion. The build generated one warning during the nsterm.m > > section, and then moved on to nsfns.m, where the build stopped. > > I think you meant nsmenu.m. > > > CC nsmenu.o > > In file included from nsmenu.m:28: > > lisp.h:2156: warning: declaration does not declare anything > > nsmenu.m: In function '-[EmacsMenu fillWithWidgetValue:]': > > nsmenu.m:652: error: stray '@' in program > > nsmenu.m:652: error: field name not in record or union initializer > > nsmenu.m:652: error: (near initialization for 'font_attribs') > > nsmenu.m:652: warning: incompatible Objective-C types initializing 'struct NSFont *', expected 'struct NSDictionary *' > > I don't know what "@" means in Objective-C, and it seems that GCC > doesn't support such a feature. Would someone please explain this piece > of code? > > NSDictionary *font_attribs = @{NSFontAttributeName: menuFont}; Welcome to the wonderful world of Objective C under GCC. The attached should fix this particular error. These problems will need to be fixed in the emacs-28 branch, assuming we're going to continue supporting macOS 10.6. FWIW, I've moved away from trying to hide warnings generated on older versions of macOS to try and avoid the difficult to understand #if constructions we've previously used throughout the code. -- Alan Third --3N0z0FsK5P7XusJV Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Fix-nsmenu-compilation-under-macOS-10.6.patch" >From f11340a5a5d234b57022908483979dfa0a9ccb99 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Tue, 19 Apr 2022 05:05:17 +0100 Subject: [PATCH] Fix nsmenu compilation under macOS 10.6 * src/nsmenu.m ([EmacsMenu fillWithWidgetValue:]): Replace modern shorthand dictionary and array definitions. --- src/nsmenu.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/nsmenu.m b/src/nsmenu.m index 81d7cd2da1..0f7d1fb98f 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -649,7 +649,8 @@ - (void)fillWithWidgetValue: (void *)wvptr work around it by using tabs to split the title into two columns. */ NSFont *menuFont = [NSFont menuFontOfSize:0]; - NSDictionary *font_attribs = @{NSFontAttributeName: menuFont}; + NSDictionary *font_attribs = [NSDictionary dictionaryWithObjectsAndKeys: + menuFont, NSFontAttributeName, nil]; CGFloat maxNameWidth = 0; CGFloat maxKeyWidth = 0; @@ -677,11 +678,12 @@ - (void)fillWithWidgetValue: (void *)wvptr NSTextTab *tab = [[[NSTextTab alloc] initWithTextAlignment: NSTextAlignmentRight location: maxWidth - options: @{}] autorelease]; + options: [NSDictionary dictionary]] autorelease]; NSMutableParagraphStyle *pstyle = [[[NSMutableParagraphStyle alloc] init] autorelease]; - [pstyle setTabStops: @[tab]]; - attributes = @{NSParagraphStyleAttributeName: pstyle}; + [pstyle setTabStops: [NSArray arrayWithObject:tab]]; + attributes = [NSDictionary dictionaryWithObjectsAndKeys: + pstyle, NSParagraphStyleAttributeName, nil]; #endif /* clear existing contents */ -- 2.35.1 --3N0z0FsK5P7XusJV--