From: John Gilmore <gnu@toad.com>
To: gdb@sourceware.org, Jan Kratochvil <jan.kratochvil@redhat.com>,
gnu@toad.com
Subject: Will C++ proponents spend 20 minutes to try what they're proposing?
Date: Wed, 18 Apr 2012 19:18:00 -0000 [thread overview]
Message-ID: <201204181918.q3IJILcF007829@new.toad.com> (raw)
In-Reply-To: <20120418151553.GA16768@host2.jankratochvil.net>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 9184 bytes --]
Jan Kratochvil said:
> I can't believe we do not agree on such basic way forward.
Changing the implementation language of a huge program, more than
twenty years after its creation, is not "basic".
Has any of the proponents even *tried* to compile and run today's GDB
using a C++ compiler, to see what C constructs that it currently uses
will be rejected by the C++ compiler? "./configure CC=g++; make check", or
something similar, should do most of that for you.
Recompiling the C code in C++ is the approach you're proposing to
take, right? Or do you propose that we compile some source files with
a C compiler and others with a C++ compiler?
If it will compile easily with a C++ compiler, then you could start
migrating small bits of it here and there to C++. If it won't compile
easily, then there's a more substantial hurdle to cross before even a
line of new C++ code could be written. Ideally if we were going to
switch to C++, we'd migrate the current code base so that it would
compile with either C or C++. Then and only then would we commit
ourselves by writing new C++ code, knowing that we still have a
working debugger.
When I configure gdb-7.4 with C++ and make it, it fails pretty early
here in libiberty:
./cplus-dem.c: In function âvoid demangle_arm_hp_template(work_stuff*, const char**, int, string*)â:
./cplus-dem.c:2351:46: error: invalid conversion from âconst char*â to âchar*â
(I'm amused that the C++ demangler is the first C function to fail.)
I've appended a bunch of other errors that turn up from "make -i".
There are MANY more, and I didn't scan beyond the "f"s in BFD. (The
GDB source files themselves also get a ton of errors). Yes, I realize
many of these are simple fixes. Perhaps a proponent should make these
fixes. Some of them bother me, e.g. "deprecated string constant
conversion to char *". C code regularly uses strings with char *'s.
Is this a foolish hobgoblin of const-correctness?
PS: When did g++ start outputting non-ascii (Unicode) backquotes
and forward-quotes in its error messages? That's truly ugly. Look
at the compiler output in Emacs, for example.
John
./md5.c: In function âvoid* md5_finish_ctx(md5_ctx*, void*)â:
./md5.c:117:43: warning: dereferencing type-punned pointer will break strict-aliasing rules
./md5.c:118:47: warning: dereferencing type-punned pointer will break strict-aliasing rules
./alloca.c: In function âvoid* C_alloca(size_t)â:
./alloca.c:164:3: warning: âautoâ will change meaning in C++0x; please remove it
./floatformat.c:22:0: warning: "_GNU_SOURCE" redefined
<command-line>:0:0: note: this is the location of the previous definition
./stack-limit.c:52:27: warning: use of C++0x long long integer constant
./stack-limit.c:54:28: warning: use of C++0x long long integer constant
./stack-limit.c:57:28: warning: use of C++0x long long integer constant
In file included from archive.c:131:0:
bfd.h:6246:31: error: âbfd_boolean bfd_section_already_linked(bfd*, asection*, bfd_link_info*)â hides constructor for âstruct bfd_section_already_linkedâ
In file included from archive.c:132:0:
./../include/libiberty.h:110:36: error: new declaration âchar* basename(const char*)â
/usr/include/string.h:603:28: error: ambiguates old declaration âconst char* basename(const char*)â
archive.c: In function âbfd_boolean _bfd_write_archive_contents(bfd*)â:
archive.c:2115:11: error: deprecated conversion from string constant to âchar*â
archive.c:2117:13: error: deprecated conversion from string constant to âchar*â
In file included from bfd.c:319:0:
cache.c: In function âvoid* cache_bmmap(bfd*, void*, bfd_size_type, int, int, file_ptr, void**, bfd_size_type*)â:
cache.c:440:27: error: pointer of type âvoid *â used in arithmetic
srec.c:1324:1: error: deprecated conversion from string constant to âchar*â
srec.c:1380:1: error: deprecated conversion from string constant to âchar*â
binary.c: In function âchar* mangle_name(bfd*, char*)â:
binary.c:135:12: error: deprecated conversion from string constant to âchar*â
binary.c: In function âlong int binary_canonicalize_symtab(bfd*, asymbol**)â:
binary.c:163:44: error: deprecated conversion from string constant to âchar*â
binary.c:171:42: error: deprecated conversion from string constant to âchar*â
binary.c:179:43: error: deprecated conversion from string constant to âchar*â
binary.c: At global scope:
binary.c:369:1: error: deprecated conversion from string constant to âchar*â
tekhex.c:1016:1: error: deprecated conversion from string constant to âchar*â
./dwarf2.c: In function âint compare_sequences(const void*, const void*)â:
./dwarf2.c:1299:38: error: invalid conversion from âconst void*â to âconst line_sequence*â
./dwarf2.c:1300:38: error: invalid conversion from âconst void*â to âconst line_sequence*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c:185:1: error: deprecated conversion from string constant to âchar*â
elf32-i386.c: In function âbfd_boolean elf_i386_grok_prstatus(bfd*, Elf_Internal_Note*)â:
elf32-i386.c:454:36: error: deprecated conversion from string constant to âchar*â
elf32-i386.c: In function âbfd_boolean elf_i386_create_dynamic_sections(bfd*, bfd_link_info*)â:
elf32-i386.c:1030:47: error: invalid conversion from âvoid*â to âunsigned char*â
In file included from elf32-i386.c:4989:0:
elf32-target.h: At global scope:
elf32-target.h:987:1: error: deprecated conversion from string constant to âchar*â
In file included from elf32-i386.c:5022:0:
elf32-target.h:987:1: error: deprecated conversion from string constant to âchar*â
In file included from elf32-i386.c:5050:0:
elf32-target.h:987:1: error: deprecated conversion from string constant to âchar*â
In file included from elf32-i386.c:5214:0:
elf32-target.h:987:1: error: deprecated conversion from string constant to âchar*â
In file included from elf32-i386.c:5259:0:
elf32-target.h:987:1: error: deprecated conversion from string constant to âchar*â
next prev parent reply other threads:[~2012-04-18 19:18 UTC|newest]
Thread overview: 116+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-30 16:14 Will therefore GDB utilize C++ or not? Jan Kratochvil
2012-04-04 20:48 ` Tom Tromey
2012-04-04 21:55 ` Mark Kettenis
2012-04-05 3:31 ` Sergio Durigan Junior
2012-04-05 11:46 ` Phil Muldoon
2012-04-06 0:35 ` Will therefore GDB utilize C++? Not John Gilmore
2012-04-06 1:35 ` Russell Shaw
2012-04-06 13:16 ` Joel Brobecker
2012-04-06 14:43 ` Russell Shaw
2012-04-06 15:34 ` Michael Eager
2012-04-06 23:32 ` John Gilmore
2012-04-07 1:04 ` Robert Dewar
2012-04-07 1:52 ` Thomas Dineen
2012-04-07 16:54 ` Michael Eager
2012-04-09 23:59 ` Stan Shebs
2012-04-05 0:22 ` Will therefore GDB utilize C++ or not? asmwarrior
2012-04-09 18:41 ` Pedro Alves
2012-04-09 19:05 ` Jan Kratochvil
2012-04-09 19:49 ` Pedro Alves
2012-04-09 20:15 ` Paul Smith
2012-04-12 20:06 ` Daniel Jacobowitz
2012-04-12 21:28 ` Paul_Koning
2012-04-13 0:04 ` Doug Evans
2012-04-18 14:10 ` Pedro Alves
2012-04-18 20:27 ` Tom Tromey
2012-04-18 14:08 ` Pedro Alves
2012-04-21 17:24 ` Daniel Jacobowitz
2012-04-16 6:55 ` Jan Kratochvil
2012-04-18 14:11 ` Pedro Alves
2012-04-18 15:16 ` Jan Kratochvil
2012-04-18 15:28 ` Pedro Alves
2012-04-18 15:54 ` Jan Kratochvil
2012-04-18 16:01 ` Pedro Alves
2012-04-18 16:07 ` Joel Brobecker
2012-04-18 16:13 ` Jan Kratochvil
2012-04-18 16:23 ` Joel Brobecker
2012-04-18 16:31 ` Joel Sherrill
2012-04-18 16:50 ` Pedro Alves
2012-04-18 16:57 ` Joel Brobecker
2012-04-18 17:28 ` Joel Sherrill
2012-04-18 17:40 ` Paul_Koning
2012-04-18 20:37 ` Frank Ch. Eigler
2012-04-18 20:38 ` Paul_Koning
2012-04-18 20:36 ` Tom Tromey
2012-04-18 17:48 ` John Gilmore
2012-04-18 19:07 ` Tom Tromey
2012-04-18 23:10 ` John Gilmore
2012-05-18 18:36 ` Tom Tromey
2012-05-18 18:47 ` Paul_Koning
2012-05-18 19:36 ` Tom Tromey
2012-05-18 19:44 ` Paul_Koning
2012-05-18 20:07 ` Tom Tromey
2012-05-18 20:41 ` Aurelian Melinte
2012-05-18 18:51 ` Lazy CU expansion (Was: Will therefore GDB utilize C++ or not?) Tom Tromey
2012-04-18 20:34 ` Will therefore GDB utilize C++ or not? Tom Tromey
2012-04-18 19:18 ` John Gilmore [this message]
2012-04-18 19:23 ` Will C++ proponents spend 20 minutes to try what they're proposing? Jan Kratochvil
2012-04-18 20:40 ` Tom Tromey
2012-04-18 20:56 ` Mike Frysinger
2012-04-18 20:31 ` Will therefore GDB utilize C++ or not? Tom Tromey
2012-04-18 20:25 ` Tom Tromey
2012-05-21 18:11 ` Pedro Alves
2012-05-21 18:36 ` Jan Kratochvil
2012-11-21 20:18 ` Jan Kratochvil
2012-04-10 0:23 ` Yao Qi
2012-04-10 9:47 ` Yao Qi
2012-04-18 20:11 ` Tom Tromey
2012-04-18 20:31 ` Can it really be ok to map GPL'd code into any old process? John Gilmore
2012-04-18 20:36 ` Pedro Alves
2012-04-23 18:03 ` Will therefore GDB utilize C++ or not? Tom Tromey
2012-05-18 19:55 ` Tom Tromey
2012-05-18 21:56 ` Joel Brobecker
2012-05-19 2:17 ` Tom Tromey
2012-05-19 15:21 ` Daniel Jacobowitz
2012-05-19 21:36 ` Joel Brobecker
2012-05-20 12:16 ` Frank Ch. Eigler
2012-05-21 15:56 ` Pedro Alves
2012-05-21 16:15 ` Jan Kratochvil
2012-05-21 17:37 ` Paul_Koning
2012-05-21 17:58 ` Jan Kratochvil
2012-05-22 18:03 ` Paul_Koning
2012-05-21 18:08 ` Pedro Alves
2012-05-21 18:08 ` Tom Tromey
2012-05-21 18:10 ` Jan Kratochvil
2012-05-21 18:54 ` Matt Rice
2012-05-26 15:50 ` Jan Kratochvil
2012-06-02 7:01 ` Russell Shaw
2012-06-02 7:13 ` Jan Kratochvil
2012-06-02 10:47 ` Russell Shaw
2012-06-02 11:10 ` Jan Kratochvil
2012-06-02 11:15 ` Russell Shaw
2012-06-02 11:15 ` Jan Kratochvil
2012-11-22 18:46 ` Jan Kratochvil
2012-11-22 21:42 ` John Gilmore
2012-11-23 15:26 ` Jan Kratochvil
2012-11-27 1:29 ` Stan Shebs
2012-11-27 2:02 ` Paul_Koning
2012-11-27 2:59 ` Stan Shebs
2012-11-27 15:17 ` Paul_Koning
2012-11-27 21:14 ` Tom Tromey
2012-04-09 23:23 ` Stan Shebs
2012-04-18 14:22 ` Pedro Alves
2012-04-18 18:12 ` Stan Shebs
2012-04-18 18:32 ` Paul_Koning
2012-04-18 18:37 ` Pedro Alves
2012-04-19 8:43 ` Yao Qi
2012-12-04 14:17 ` Jan Kratochvil
2012-12-04 14:44 ` Mark Kettenis
2012-12-04 14:52 ` Jan Kratochvil
2012-12-06 20:39 ` Matt Rice
2012-12-07 12:57 ` Jan Kratochvil
2012-12-07 13:25 ` Yao Qi
2012-12-11 6:25 ` Matt Rice
2012-12-13 15:12 ` Jan Kratochvil
2012-12-14 11:03 ` Matt Rice
2012-12-14 12:16 ` Jan Kratochvil
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=201204181918.q3IJILcF007829@new.toad.com \
--to=gnu@toad.com \
--cc=gdb@sourceware.org \
--cc=jan.kratochvil@redhat.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).