public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "brodhow at all2easy dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/57853] pointer arithmetic on arrays
Date: Mon, 08 Jul 2013 22:06:00 -0000	[thread overview]
Message-ID: <bug-57853-4-K5EpjpkaPn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57853-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57853

Howard Brodale <brodhow at all2easy dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |---

--- Comment #3 from Howard Brodale <brodhow at all2easy dot net> ---
++arr[0][0] does work for printing out the second character 's'. But, then that
pointer arithmetic operation has the side effect of wiping out the 'a' from
"as". Because when 

for (i=0; i<2; ++i)
   for (j=0; j<3; ++j)
     printf("%s ", arr[i][j]); 

runs, it just prints 's' for where "as" should be.  The 'a' is now gone or
destroyed by the previous ++arr[0][0] operation. Wgen that "++" is removed then
"as" prints from those for loops after where the printf with the "++" was.

 So, this bug is not invalid! And, is not resolved!


  parent reply	other threads:[~2013-07-08 22:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 20:03 [Bug c/57853] New: " brodhow at all2easy dot net
2013-07-08 20:10 ` [Bug c/57853] " brodhow at all2easy dot net
2013-07-08 20:17 ` pinskia at gcc dot gnu.org
2013-07-08 22:06 ` brodhow at all2easy dot net [this message]
2013-07-08 22:08 ` pinskia at gcc dot gnu.org
2013-07-08 22:10 ` brodhow at all2easy dot net
2013-07-08 22:13 ` brodhow at all2easy dot net
2013-07-08 22:15 ` brodhow at all2easy dot net
2013-07-08 22:18 ` pinskia at gcc dot gnu.org
2013-07-09  3:08 ` brodhow at all2easy dot net
2013-07-09  4:15 ` brodhow at all2easy dot net
2013-07-09  4:24 ` pinskia at gcc dot gnu.org
2013-07-09  6:52 ` brodhow at all2easy dot net
2013-07-09  7:15 ` schwab@linux-m68k.org
2013-07-09 10:28 ` redi at gcc dot gnu.org

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=bug-57853-4-K5EpjpkaPn@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).