From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 570AF82899 for ; Sat, 11 Jan 2025 17:12:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736615575; cv=none; b=NJsADuz35r6qBRYFFt9IoYNR90xVgwgRz5O6Y3z3sIxuaI+eVSeRR5Soz0X3WzOG6ulsaIUvL8gui1obE5zzoQ6TU33gcVhvX0mXX2JcMUtQBb/DzHuc4t+KReZMKofANCEciz8UgtR5OTXOuzIHi0tMLLTlBzHYOdACSvI3ygo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736615575; c=relaxed/simple; bh=5ir4AC6FlJQQedZv4iYZfABCyt5IIteXUQKTxvAxcdE=; h=Message-ID:Subject:From:To:Date:In-Reply-To:References: MIME-Version:Content-Type; b=V7fAiwbuYgKattsoMEWXHKoneAvr8cyu6IonaXaMoY0ehF8DMFMjdMbmnGP1SrBDJb6y1gjTsqHd38wfPG2D15d9/b8vdvCnx7/33KvIH1YgqlKRXz0dpMnOtMqQQrVlHoahYSuKb3uGGi/N6KAVnDuz5LCywvo3QtSUXbndt8E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=JB/4/gRP; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JB/4/gRP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736615571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5ir4AC6FlJQQedZv4iYZfABCyt5IIteXUQKTxvAxcdE=; b=JB/4/gRPG9ahHoabp2IVqWblcJ7scz+aAGe/ziZpFRkZPtjFzxhLRgihCSGd9Q9REKOgn/ rnNXfmfQqND+FCzgnXdMro2goSOl4lu9TQn0PbC9pI7/XdvwuDQX/RjjKwtAUzlRZc/lpi 6DTgRA2Jgp74qaxxnWqWkPqxH8ZlSdA= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-PQjHmVNDPfK3sAzvYytx4Q-1; Sat, 11 Jan 2025 12:12:49 -0500 X-MC-Unique: PQjHmVNDPfK3sAzvYytx4Q-1 X-Mimecast-MFC-AGG-ID: PQjHmVNDPfK3sAzvYytx4Q Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7b9f0bc7123so499750885a.1 for ; Sat, 11 Jan 2025 09:12:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736615568; x=1737220368; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=CAFUwFDi5005zBK806FZL8clol0vWk7tO6F/CLIeuMo=; b=KrgM9+NfOR56eCg262sNH0tVs6tU59hdMEZ/rgiNQ0H3H+UWXL+e+/8pRGJqktujou TQvvTYF4/j9APjKhoxEm7QGGWGz1ao4cohVrKfEds1fzS230fqQNl6rWD1Qbtg/OPqWf WrvjP/QQsS2dBOXwWhXEH/q/uIy5gq2nqsAy9j4kX91jpXo2jZoUVepg6McOg0YvnLef h1/1LzwdjQQQaYODvGDeMr4hG4q90/1BuEM7Gy15XEoQkP9XhIdhgkVmrlfAjCNo5pUV ea0MRxT0F1BVfE2QHPXLR5wKSWMYA51s/SRMIo6uXvbn+4JzKHZJSCZaVoEPr8x0qxGP Zqlw== X-Forwarded-Encrypted: i=1; AJvYcCWJk/SanEjNlqWFL9taW0TE9ZtDjoJ4j6LGcP+zMBZgrQN+PXZoU2eSvbW5mtO0O1alS7dJAca1XSTasX6gqUoR@vger.kernel.org X-Gm-Message-State: AOJu0YxUxasOW6Z8j3yfWAmI4EIdUl8Unx9fx+xEf453dXYLauxkjyuo d9EjPj29oVkAxhU9edbiGM1qRFn9N05TYyKp6WTrHVnWf7R0mthM/c24c8+R8lVsI+svGPd3y+t r249fyMR/wRXN59kNJ0vXIjAEOY3/8IDIl7ZVF0c52KUQW4mJvSwpMTKrkw3/SDx8CHAFnUZ7Ur s= X-Gm-Gg: ASbGncsbCASAD06iR0RG+s7A6+32VBlSj5n4dSYTpYXbySKJHXRY6BvOu4+lB3GvTFv PsknIIWPQjbpHOCdP+7uwqczXmejPsiwHe4bI06fJw73l3zQnGBjIZeASxsSvKe7SMkHHRb6qkO Hv0y5JIAsojdNABSGG9Iuq2Uoea7qCgpKKuoZWsKJApltQ2I6wFmHRcPQ6Kn0MsHtZPy3yM3qm0 M5YEiY+RxqC0i6X81aGBrWlz25Rb/Pj/a8+f3YaEJX03WH+PFmN8uYUIYcvax6ZYLOBNmg+7+aA Z/W/UY5q2ioCIuxA X-Received: by 2002:a05:620a:28ca:b0:7b6:6e3f:49dc with SMTP id af79cd13be357-7bcd9788125mr1082401385a.31.1736615568586; Sat, 11 Jan 2025 09:12:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IG67FJwXGvzrGWDSC0Bh2A6mP9m2bqA0Zw9T09R0dErJxoxKT5/S7ljeQLr5qSEy26WwkZRBg== X-Received: by 2002:a05:620a:28ca:b0:7b6:6e3f:49dc with SMTP id af79cd13be357-7bcd9788125mr1082398085a.31.1736615568245; Sat, 11 Jan 2025 09:12:48 -0800 (PST) Received: from t14s.localdomain (c-73-38-81-7.hsd1.nh.comcast.net. [73.38.81.7]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7bce3502a56sm297014885a.91.2025.01.11.09.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Jan 2025 09:12:47 -0800 (PST) Message-ID: <678b06548be13a75ce3ebfb8a3a019ca60285f95.camel@redhat.com> Subject: Re: Do we care if C compilers start allowing "." on pointers? From: David Malcolm To: paulmck@kernel.org, linux-toolchains@vger.kernel.org Date: Sat, 11 Jan 2025 12:12:45 -0500 In-Reply-To: <6c55adc5-52f9-45e2-aa20-ef344c9dd1ea@paulmck-laptop> References: <6c55adc5-52f9-45e2-aa20-ef344c9dd1ea@paulmck-laptop> User-Agent: Evolution 3.52.4 (3.52.4-1.fc40) Precedence: bulk X-Mailing-List: linux-toolchains@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: r3C-vhjw5TVVT3OvVn-0HeYXuegoOSkrAzcc7HkuF-8_1736615569 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2025-01-10 at 07:02 -0800, Paul E. McKenney wrote: > Hello! >=20 > Currently, given a pointer "p", C allows p->a but not p.a.=C2=A0 There is > a > proposal from C++ [1] that is being considered for C. >=20 > Do we care? Is the proposal likely to actually happen to either C++ or C? I hope the proposal can be ignored; FWIW (with as a GCC diagnostics maintainer) the proposal seems a bad idea to me: the proposal (in "C++ Compiler modification notes") seems to be suggesting this is a relatively simple change to the compiler - but it seems to not account for: - the cost of teaching language users about the change - the cost of bifurcating the languages into before/after the change - providing useful compiler diagnostics if someone tries to compile code using this with an older version of the language - support for this in IDEs (e.g. code-completion) - dealing with smart pointers and operator overloading in C++ - in C++ this may open up a huge can of worms relating to template substitutions, since it (perhaps; not sure) might allow previously- failing substitutions to succeed, thus breaking existing codebases ...etc I don't buy the supposed motivations at all, e.g. "Simplifies the knowledge required to start programming in C" ...by adding a new fundamental way to do things, decades in; surely this just complicates things? C has its warts, but=20 These are just my personal opinions, of course. Hope this is constructive Dave >=20 > =09=09=09=09=09=09=09Thanx, Paul >=20 > [1] > https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2142r1.pdf >=20