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 22C9F2CAB for ; Sun, 12 Jan 2025 19:57:39 +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=1736711861; cv=none; b=oVccPjeWXcntFKSqwEofnEy6cV+kv+r00cED0kfPAjM+6JM8Wn6l7QIzxmgPoImq1SIeCjFmncUzdInj8ksLItTsTZZMGCNFWAF3neBYKcvyzT6zLsmmFEdjG4xZIT90DzsgmBOs/wTnA2Kjs/ZUVPJJT5AaSwpIdI2uvZsp8zI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736711861; c=relaxed/simple; bh=2vj946q5+VTN7m9WfGtfJFTBtFDTCM8nYWsIr2uWlc8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=cPzp0qpHH944/ckbIgW61pu9PXQ2FA8gRZJ0Q1g66HObgWFuJo5SydD+fd7Dcuw52id7y2E4o2wAWTXpmZp4KXAzpVeFLBQ8OjmXkj0dYtsMKe7+TEmH/YBBV/nmbnpsb+SUOPwCpkY5Hcuu4CQtEW2Ng+EDC6uSzYMdCDt+V8A= 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=eTd2+fvR; 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="eTd2+fvR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736711859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hkXZ0QGwu0q+uo63fA1XzfbAScdSWOBgZSW2ForqoSo=; b=eTd2+fvRPZSOnJ/uiiSeX1gnUWl/ziDR7p8CeCsWb+G8Jb35Rf+siuTjrUTj2tx6nBnWl7 FurKdNitaFm05/ApsMI5j+WvBvBoFuQITEYQg5PTYiGDfaZY7UnYG4q0CyvcjX65rKfJWD iqhZS5jcXz8f/arib9ivLRA0HKc4UAc= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-103-KOa4oCclPueChKqCCL6NIw-1; Sun, 12 Jan 2025 14:57:35 -0500 X-MC-Unique: KOa4oCclPueChKqCCL6NIw-1 X-Mimecast-MFC-AGG-ID: KOa4oCclPueChKqCCL6NIw Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BD6111955DCF; Sun, 12 Jan 2025 19:57:34 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.8]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4A8C01956056; Sun, 12 Jan 2025 19:57:32 +0000 (UTC) From: Florian Weimer To: Bill Wendling Cc: paulmck@kernel.org, linux-toolchains@vger.kernel.org Subject: Re: Do we care if C compilers start allowing "." on pointers? In-Reply-To: (Bill Wendling's message of "Fri, 10 Jan 2025 17:09:21 -0800") References: <6c55adc5-52f9-45e2-aa20-ef344c9dd1ea@paulmck-laptop> Date: Sun, 12 Jan 2025 20:57:29 +0100 Message-ID: <87frln6c0m.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-toolchains@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: FR5J21iA1i1GW8DhdEaOH_sdIa2BOpKzd4wwD4TGIdY_1736711854 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable * Bill Wendling: > On Fri, Jan 10, 2025 at 7:02=E2=80=AFAM Paul E. McKenney wrote: >> >> Hello! >> >> Currently, given a pointer "p", C allows p->a but not p.a. There is a >> proposal from C++ [1] that is being considered for C. >> >> Do we care? >> > Does the proposal seem likely to be added to C++? The motivation is > very weak, in my opinion. Other languages are very different from > C/C++; they try to hide away memory management details, which are a > major part of C languages. (To prevent a holy war, my comments aren't > about the benefits and drawbacks of memory management in other > languages.) User-defined pointer-like types obviously have to use -> for the deference operation because . is reserved for operations on the pointer object itself. So certain templated code would have to remember to use -> anyway. So it's surprising this proposed in the C++ context. For C as of today, this wouldn't matter. However, if we ever get bounds-carrying pointers, writing p.length or p.limit to access such information with the pointer p would make sense. Thanks, Florian