public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Amol Surati <suratiamol@gmail.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Assignment of union containing const-qualifier member
Date: Mon, 12 Feb 2024 16:48:37 +0530	[thread overview]
Message-ID: <CA+nuEB_+_rDtm_e0T-gTQMdn9C3j8ZDZB7=m+0oNnOUp0dmV-A@mail.gmail.com> (raw)
In-Reply-To: <CA+nuEB8gk+tvp25AzOhEfXD9DczzHZvkD6NEmNo+5oD9L6ch=w@mail.gmail.com>

Typo in the sock_addr section.

Please read
"So typecasting between object types is well-defined, given that the"
as
"So typecasting between pointer types is well-defined, given that the"

> The std says:
> "A pointer to an object type may be converted to a pointer to a different
> object type. If the resulting pointer is not correctly aligned for the
> referenced type, the behavior is undefined. Otherwise, when converted
> back again, the result shall compare equal to the original pointer."
>
> So typecasting between object types is well-defined, given that the
> resulting pointer is indeed correctly aligned for the target type. The
> various sock_addr types all impose a common default alignment,
> because they all begin with a member of the same type.

-Amol

  reply	other threads:[~2024-02-12 11:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30 21:45 Alejandro Colomar
2024-01-31 18:14 ` Alejandro Colomar
2024-02-04  7:33   ` Amol Surati
2024-02-04  8:18     ` Amol Surati
2024-02-04 18:40     ` Alejandro Colomar
2024-02-04 20:37       ` Alejandro Colomar
2024-02-07  4:13       ` Amol Surati
2024-02-07 13:29         ` Alejandro Colomar
2024-02-12 10:45           ` Amol Surati
2024-02-12 11:18             ` Amol Surati [this message]
2024-03-18  9:19             ` Alejandro Colomar
2024-03-18  9:23               ` Alejandro Colomar

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='CA+nuEB_+_rDtm_e0T-gTQMdn9C3j8ZDZB7=m+0oNnOUp0dmV-A@mail.gmail.com' \
    --to=suratiamol@gmail.com \
    --cc=alx@kernel.org \
    --cc=gcc-help@gcc.gnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).