public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug compile/31508] New: compile not working for some programs
@ 2024-03-19  7:35 tsqurt at outlook dot com
  2024-03-24 11:07 ` [Bug compile/31508] " tsqurt at outlook dot com
  2024-03-24 17:20 ` tromey at sourceware dot org
  0 siblings, 2 replies; 3+ messages in thread
From: tsqurt at outlook dot com @ 2024-03-19  7:35 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31508

            Bug ID: 31508
           Summary: compile not working for some programs
           Product: gdb
           Version: 15.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: compile
          Assignee: unassigned at sourceware dot org
          Reporter: tsqurt at outlook dot com
  Target Milestone: ---

```
int main ()
{
  int n = 2;
  struct S
  {
    int i[n];
  };

  struct S s[3];
  s[0].i[0] = 0;
  return 0;
}
```
The `expr` command fails even for trivial cases.

```
gcc src.c -g && gdb a.out
(gdb) b 11
Breakpoint 1 at 0x12f0: file src.c, line 11.
(gdb) run
Starting program: a.out 

Breakpoint 1, main () at src.c:11
11        return 0;
(gdb) expr 1
/tmp/gdbobj-YZnp7a/out1.c:50:43: error: redeclaration of
‘__gdb_prop_0x5565ba93ba70’ with no linkage
   50 |   __attribute__ ((unused)) unsigned long  __gdb_prop_0x5565ba93ba70;
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/gdbobj-YZnp7a/out1.c:30:43: note: previous declaration of
‘__gdb_prop_0x5565ba93ba70’ was here
   30 |   __attribute__ ((unused)) unsigned long  __gdb_prop_0x5565ba93ba70;
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~
Compilation failed.
```

Version:
gcc (GCC) 14.0.1 20240312 (experimental)
GNU gdb (GDB) 15.0.50.20240313-git

Platform:
ubuntu 20.04 LTS

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-24 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-19  7:35 [Bug compile/31508] New: compile not working for some programs tsqurt at outlook dot com
2024-03-24 11:07 ` [Bug compile/31508] " tsqurt at outlook dot com
2024-03-24 17:20 ` tromey at sourceware dot org

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).