public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "slyfox at inbox dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/95942] [11 regression] offsetof on an array: error: 'e' is not a constant expression
Date: Wed, 15 Jul 2020 20:56:47 +0000	[thread overview]
Message-ID: <bug-95942-4-rmGciV4Q9Q@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-95942-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95942

--- Comment #3 from Sergei Trofimovich <slyfox at inbox dot ru> ---
Another example is edb-debugger project
https://github.com/eteran/edb-debugger/blob/070d0196227a58ce2ba15c695944ba16ce66c080/plugins/DebuggerCore/unix/linux/arch/x86-generic/PlatformThread.cpp#L331:

  long PlatformThread::setDebugRegister(std::size_t n, unsigned long value) {
        return ptrace(PTRACE_POKEUSER, tid_, offsetof(struct user,
u_debugreg[n]), value);
  }

Fails build on gcc-11 as:

 
edb-debugger/plugins/DebuggerCore/unix/linux/arch/x86-generic/PlatformThread.cpp:331:72:
error: 'n' is not a constant expression
    331 |  return ptrace(PTRACE_POKEUSER, tid_, offsetof(struct user,
u_debugreg[n]), value);
        |                                       ^

  parent reply	other threads:[~2020-07-15 20:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-27 18:22 [Bug c++/95942] New: " slyfox at inbox dot ru
2020-06-27 18:29 ` [Bug c++/95942] " slyfox at inbox dot ru
2020-06-27 18:34 ` mpolacek at gcc dot gnu.org
2020-06-29 10:37 ` rguenth at gcc dot gnu.org
2020-07-15 20:26 ` ppalka at gcc dot gnu.org
2020-07-15 20:56 ` slyfox at inbox dot ru [this message]
2020-07-15 21:09 ` jakub at gcc dot gnu.org
2020-10-12 12:51 ` rguenth at gcc dot gnu.org
2020-10-15 16:45 ` jason at gcc dot gnu.org
2020-10-15 21:40 ` slyfox at gcc dot gnu.org
2021-04-27 19:39 ` jakub at gcc dot gnu.org
2024-02-07 15:06 ` pinskia 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-95942-4-rmGciV4Q9Q@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).