From: Paul Koning <paulkoning@comcast.net>
To: Tomas Bortoli <tomasbortoli@gmail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Unexpected behavior of gcc on pointer dereference & increment
Date: Fri, 1 Sep 2023 12:54:12 -0400 [thread overview]
Message-ID: <EC13FEAE-5E2C-472F-94D2-BC7BDEDFA6ED@comcast.net> (raw)
In-Reply-To: <CAAHj5qiDgnHadcgSj1-80sqj8szRs_7XanjvLFkbg2DLTVjULA@mail.gmail.com>
> On Sep 1, 2023, at 12:35 PM, Tomas Bortoli via Gcc <gcc@gcc.gnu.org> wrote:
>
> Hi,
>
> I recently discovered that the following C statement:
>
> pointer++;
>
> is semantically equivalent to the following:
>
> *pointer++;
>
> Is this due to operators' priority? To me, that looks weird.
Yes, https://en.cppreference.com/w/c/language/operator_precedence shows that. Liberal use of parentheses is a very good practice.
paul
prev parent reply other threads:[~2023-09-01 16:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 16:35 Tomas Bortoli
2023-09-01 16:50 ` David Edelsohn
2023-09-01 16:54 ` Paul Koning [this message]
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=EC13FEAE-5E2C-472F-94D2-BC7BDEDFA6ED@comcast.net \
--to=paulkoning@comcast.net \
--cc=gcc@gcc.gnu.org \
--cc=tomasbortoli@gmail.com \
/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).