From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4378 invoked by alias); 23 Jul 2011 18:43:25 -0000 Received: (qmail 4369 invoked by uid 22791); 23 Jul 2011 18:43:24 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 23 Jul 2011 18:43:08 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6NIh7OT010695 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 23 Jul 2011 14:43:07 -0400 Received: from host1.jankratochvil.net (ovpn-116-20.ams2.redhat.com [10.36.116.20]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6NIh5Sm025833 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 23 Jul 2011 14:43:07 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p6NIh5C0026295; Sat, 23 Jul 2011 20:43:05 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p6NIh4AL026294; Sat, 23 Jul 2011 20:43:04 +0200 Date: Sat, 23 Jul 2011 21:38:00 -0000 From: Jan Kratochvil To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [rfc] Be in language c more c++ compatible Message-ID: <20110723184304.GA26133@host1.jankratochvil.net> References: <20110715191920.GA29975@host1.jankratochvil.net> <201107231838.p6NIcBDq020651@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201107231838.p6NIcBDq020651@glazunov.sibelius.xs4all.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00657.txt.bz2 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