From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: master 37889523278: Add new `swap` macro and use it Date: Sat, 06 Jan 2024 17:09:04 +0800 Message-ID: <87h6jq96bz.fsf@yahoo.com> References: <170452579053.27998.16123231327386305897@vcs2.savannah.gnu.org> <20240106072311.28B8FC0034E@vcs2.savannah.gnu.org> <87plye9ahs.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9960"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org, Paul Eggert , Eli Zaretskii To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jan 06 10:10:12 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 1rM2h2-0002Tz-LI for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jan 2024 10:10:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rM2gK-0001qh-Vc; Sat, 06 Jan 2024 04:09:29 -0500 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 1rM2gF-0001qT-Dk for emacs-devel@gnu.org; Sat, 06 Jan 2024 04:09:25 -0500 Original-Received: from sonic316-22.consmr.mail.ne1.yahoo.com ([66.163.187.148]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rM2gD-0003R3-3P for emacs-devel@gnu.org; Sat, 06 Jan 2024 04:09:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1704532158; bh=pAlYD+sdnYjR7OwCpxYlU1gqfq1JgFJo+EMSGBqtJUU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=Hd9Hgthr0aqqqlCuOXnc+wmrCQWW4XdW581fVp/DIOnV2I210hlqxRnS4pSLNh1bGw40Ug+4eP6DoAexHCe1/X+nJcgaNdZ46QkFxIQyUSxMP0SbLCRZ12Q6u3cnGXuoCk2nnNZADbNSy6j1PIl4rokArBvwMviLBir2VBj4SyjenCqnClFZpcdnoSI9RoFkOTouz3jRuKggiSsHfb+VlLkoYqK6S05AZtTUWFkq7tLy3dMMvUKr9LTEVnkVOlTg+k9gDqldkzY5tNcv1QHr3hjQ+yO2unFL4xFOspgK/lGMK7OfD6hFyg4uEqPOqtwgLA/5MHe5svNl9MO10ZzD/g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1704532158; bh=Q5vTR4DCUpdkouwtqY0sdH0nxCZgc7TvmdVG7ddUAlX=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=M5MZSUJOQ/Qt7HR3xzauBx9p3SU8uJzOxad6fdbo2VZqnBeL9hJUuVYYgq4XjZDXka95O+FaElLnN6aVCz2H7bereLGs4Im7GyOybYuPVOGc9AFDPbtQSnn4srNXJ1Qawo2u+hxF48Qgf0oDSpI7Ir0tW6tP0+iT/2rDAhckheLYT4XjMqQfDCxQTXe4CQCtGjtQowy53sH1I4VYaejjXS9XTUgm3j2JIayCbGoaNuWxkh9GPunf7rVy89HLzHp3xVqK1w8yWGVVcq7+6J63ZjltnqvY3Cs7GWNdQwnww3mFwT/xQfTKbuoKGO8mmbDYcG+LsSOBuCSx9BrZ/TClgg== X-YMail-OSG: tGcVH8cVM1lpBQb36KigcpuQNmU5K.m7WOAXGrX28VI6sHUfDXVO07.2VmL2cv_ O0ZJ7t7zvhHwmg1oklNUcrJhKAku1CAqvjEC.XsrQGRgrnwiQvcZeohlFQ_fD4Q4_gemhL3NgBru 8seGsCXjp21rJ0bkqFeO2ucniFloJUUP8ewZbdFFUnBLP92qvVh9x8tcJEpNRKm3XyO_6JKd0ZCx 0xhcQjYeHBSsdZUZUnO_0UF4UBa8nfyj8.OdKESq6FF_L7jN5d4Vhitkf3Vr6V46QRJMDTktnqNR uBQ_C4z2V.obLK8dAbUA9yE4PmllV2QJZEbqVwFj1XhV_flXFqnUQr2k46K4o0024mofP2JzV.MJ y4suKjbZPayLl.W3vZaMHWRRRcChNprT6jTzvLjdq.bvqdsx.e9YDZWtg0CD5.Jmav7V9Hd7KAmt 0KHk_w6gwE23obxgNM2x_eyZqSHsvuX7WhHAPwKTgiMgLxknCA.E6innqy83mIfBtiU.J07Ee0qo XYvJ.uQV7gVGjTPkSuocS91gZTQJfVp4ss3oGG8GCjruLVcwL5osmBmpnOSAjkjpeIpWRAJH0lfV QFXm0va4Qa5s5ajW19DDBRPFbWGd3lurG5W_YFo_0rbWHaynlUWbtQwOUa1sHFkYMBQDoB3QJO9G k6jff291fdG42rZWyABfNd8dMP6uSGg4qXDBBdmNDljdWLLmkeQzsQ8cPl9wCKz7_ZStWphpwiCW .JAjk5pMeeeCHcL5P2fiUz2jpNHJH.wwXnsT8q.p8BdnOQ.B4eGSxsir2LAhuk2ezee7Cbc6wrdj lDqUxUqjQHZ2WaPmTG2PjY3QioLw9SQ6Rl0oYwhlV4 X-Sonic-MF: X-Sonic-ID: d05ceb2d-8777-4d58-abb2-d5275acb2297 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Sat, 6 Jan 2024 09:09:18 +0000 Original-Received: by hermes--production-sg3-65d57d948b-ngz7m (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 01b08d885f6cdf3a2fcc0ed38011e611; Sat, 06 Jan 2024 09:09:13 +0000 (UTC) In-Reply-To: (Stefan Kangas's message of "Sat, 6 Jan 2024 00:50:55 -0800") X-Mailer: WebService/1.1.21952 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.187.148; envelope-from=luangruo@yahoo.com; helo=sonic316-22.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:314599 Archived-At: Stefan Kangas writes: > Ouch, right. I was inspired by some other large project, let's leave it > unnamed, but their C chops were big enough that I let my guard down. > Unfortunately for me, they happen to support far fewer compilers than we > do. Sorry about that, and thanks for being on your toes. > > I had a look at what Gnulib has, and came up with the attached patch. > It still lets us avoid the type conversion problems on GCC, clang and > reasonably recent versions of IBM C and sunc. I'm not sure it's worth > it though, so perhaps my original patch should just be reverted. That's worse, since code using the macro incorrectly will function on some compilers but not others. I suggest leaving programmers to manually swap variables as they have always done: the brief fascination with macros all C programmers experience never fails to produce unnecessary macros for simple operations that yield little benefit, and "swap" operations are no exception.