[Bug gdb/34308] New: p sizeof(bool) gets an error

"duncan_roe at optusnet dot com.au via Gdb-prs" <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34308

            Bug ID: 34308
           Summary: p sizeof(bool) gets an error
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: duncan_roe at optusnet dot com.au
  Target Milestone: ---

Created attachment 16790
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16790&action=edit
C program to demonstrate issue

bool is a variable type in C23 but gdb is unaware of it.
attachment hello.c declares "b" as "bool":-
gcc -g3 -gdwarf-5 -o hello hello.c
16:50:24$ gdb hello
GNU gdb (GDB) 18.0.50.20260619-git
Reading symbols from hello...
(gdb) b main
Breakpoint 1 at 0x401135: file hello.c, line 7.
(gdb) run
Starting program: /dimstar/home/dunc/tests/hello 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, main (argc=1, argv=0x7fffffffdca8) at hello.c:7
7         nc = write(1, "Hello world!\n", 13);
(gdb) p sizeof b
$1 = 1
(gdb) ptype b
type = _Bool
(gdb) p sizeof(_Bool)
$2 = 1
(gdb) p sizeof(bool)
❌ No symbol "bool" in current context.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.