Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] Be in language c more c++ compatible
Date: Sat, 23 Jul 2011 21:38:00 -0000	[thread overview]
Message-ID: <20110723184304.GA26133@host1.jankratochvil.net> (raw)
In-Reply-To: <201107231838.p6NIcBDq020651@glazunov.sibelius.xs4all.nl>

On Sat, 23 Jul 2011 20:38:11 +0200, Mark Kettenis wrote:
> > echo 'class C { typedef int t; t i; } c;'|g++ -c -o 1.o -g -x c++ -
> 
> Isn't that a GCC bug?  I mean, if code is compiled with the C++
> compiler it should be tagged as such in the debug info shouldn't it?

I take the point that in these cases only a single CU is loaded.  While
currently GDB does not consider such CU for language detection (such as
because it does not contain `main') one possible fix is to just follow the CU
language, if it is the only CU loaded.


> > The first (c-exp.y) part parses those parts of `language c++' which cannot
> > (I believe - RFC) lead to misinterpretation of any valid C code even in
> > `language c'.
> 
> I think this is a bad idea.

There was another mail about use case when you combine C/C++ application/libs.

What are disadvantages of interpreting something as C++ instead of giving
error on such expression?


Thanks,
Jan


  reply	other threads:[~2011-07-23 18:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 20:47 Jan Kratochvil
2011-07-16  8:42 ` Tom Tromey
2011-07-16  9:45   ` Jan Kratochvil
2011-07-23 21:17 ` Mark Kettenis
2011-07-23 21:38   ` Jan Kratochvil [this message]
2011-07-25 15:00   ` Tom Tromey
2011-07-23 22:12 ` Matt Rice
2011-07-24 15:59   ` Jan Kratochvil
2011-07-24 15:59     ` Matt Rice
2011-07-25 14:52       ` Tom Tromey

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=20110723184304.GA26133@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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