All of lore.kernel.org
 help / color / mirror / Atom feed
From: Demi Marie Obenour <demiobenour@gmail.com>
To: Elliott Mitchell <ehem+xen@m5p.com>, Jan Beulich <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Julien Grall" <julien@xen.org>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Roberto Bagnara" <roberto.bagnara@bugseng.com>,
	"Nicola Vetrini" <nicola.vetrini@bugseng.com>,
	"consulting @ bugseng . com" <consulting@bugseng.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>
Subject: Re: [PATCH] xen: Use __auto_type
Date: Mon, 12 May 2025 19:04:42 -0400	[thread overview]
Message-ID: <b7e112db-6e41-401d-9486-eb561c4786b7@gmail.com> (raw)
In-Reply-To: <aCI9MZRN1A753Nw9@mattapan.m5p.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1622 bytes --]

On 5/12/25 2:25 PM, Elliott Mitchell wrote:
> On Mon, May 12, 2025 at 03:00:18PM +0200, Jan Beulich wrote:
>> On 12.05.2025 14:09, Andrew Cooper wrote:
>>>
>>> Now for the (new) controversial part.  Since sending this, Linux has
>>> decided to just #define auto __auto_type for C < 23, in order to start
>>> writing C23 compatible code from now.  It's more succinct, and has
>>> better longevity.
>>>
>>> We might want to consider the same, although it will introduce a new
>>> example of defining a keyword, which we'd have to call out in the
>>> MISRA/Eclair config.
>>
>> I'm not outright opposed, as I don't think we use "auto" with its
>> original semantics, but it feels somewhat odd.
> 
> Problem is "auto" already has a defined meaning in C.Having this will
> subtly break contributions from authors who weren't familiar with
> everything in Xen's headers.  For anyone who does anything with projects
> besides Xen this will encourage bad habits.
> 
> I believe many projects have a rule of *never* #define C keywords.  I'm
> surprised such made it into the Linux kernel.  I expect it will be ripped
> out in the near future.
> 
> MISRA *doesn't* absolutely forbid this?

I'm no expert on the C standard, but my understanding is that "auto" was
redundant starting in C89, so it is almost entirely unused.  C++11 and later
*do* heavily use "auto", and they use it for roughly the same purpose as C23
does, so I suspect that contributors are far more likely to be familiar with
the C23 "auto" than they are with the pre-C23 version, 
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2025-05-12 23:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-05 12:46 [PATCH] xen: Use __auto_type Andrew Cooper
2025-05-05 12:57 ` Nicola Vetrini
2025-05-05 13:00   ` Andrew Cooper
2025-05-05 19:44 ` Stefano Stabellini
2025-05-12 11:59   ` Jan Beulich
2025-05-12 12:09     ` Andrew Cooper
2025-05-12 12:41       ` Frediano Ziglio
2025-05-12 13:00       ` Jan Beulich
2025-05-12 18:25         ` Elliott Mitchell
2025-05-12 19:58           ` Nicola Vetrini
2025-05-12 23:04           ` Demi Marie Obenour [this message]
2025-05-12 23:31             ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7e112db-6e41-401d-9486-eb561c4786b7@gmail.com \
    --to=demiobenour@gmail.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=consulting@bugseng.com \
    --cc=ehem+xen@m5p.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=nicola.vetrini@bugseng.com \
    --cc=roberto.bagnara@bugseng.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.