From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Re: /lib/cpp not found in c-mode Date: Thu, 5 May 2005 22:58:45 +1200 Message-ID: <17017.64613.316775.721866@farnswood.snap.net.nz> References: <17013.26868.207510.370151@farnswood.snap.net.nz> <17013.52411.51878.781739@farnswood.snap.net.nz> <17014.39042.74353.677362@farnswood.snap.net.nz> <01c55014$Blat.v2.4$59df46a0@zahav.net.il> <01c550ec$Blat.v2.4$3b8fa220@zahav.net.il> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1115292852 10324 80.91.229.2 (5 May 2005 11:34:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 5 May 2005 11:34:12 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 05 13:34:10 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DTebI-0008KU-Jk for ged-emacs-devel@m.gmane.org; Thu, 05 May 2005 13:33:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DTein-00049u-F5 for ged-emacs-devel@m.gmane.org; Thu, 05 May 2005 07:40:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DTeMD-0001v7-Lr for emacs-devel@gnu.org; Thu, 05 May 2005 07:17:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DTeHF-0000Ij-CJ for emacs-devel@gnu.org; Thu, 05 May 2005 07:12:22 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DTeDH-0007Rd-Hn for emacs-devel@gnu.org; Thu, 05 May 2005 07:08:15 -0400 Original-Received: from [202.37.101.8] (helo=viper.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DTe90-0005WQ-Mj; Thu, 05 May 2005 07:03:51 -0400 Original-Received: from farnswood.snap.net.nz (p124-tnt1.snap.net.nz [202.124.110.124]) by viper.snap.net.nz (Postfix) with ESMTP id 711DE4B1A7E; Thu, 5 May 2005 22:58:36 +1200 (NZST) Original-Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 0C26562A99; Thu, 5 May 2005 11:58:45 +0100 (BST) Original-To: Eli Zaretskii In-Reply-To: <01c550ec$Blat.v2.4$3b8fa220@zahav.net.il> X-Mailer: VM 7.19 under Emacs 22.0.50.37 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:36699 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36699 > > > ??? Isn't it a simple matter of looking at the Makefile and passing > > > the relevant switches to the preprocessor? If the Makefile is too > > > complex to figure out the switches, I usually invoke "make foo.o" to > > > see what switches it uses, then copy them into the c-macro-expand's > > > prompt for arguments. > > > > Seems like much too much trouble compared to the functionality offered, > > Not when you really need it, like when a complicated macro causes some > bug or compiler message you cannot figure out. As I'm sure you know, GCC (3.1 onwards) provides macro information if you specify the options -gdwarf-2 and -g3. So while debugging you can expand a macro with /* -*- compile-command: "cc -g3 -o myprog myprog.c myprint.o -lm"; -*- */ #include #include (gdb) macro expand M_PI expands to: 3.14159265358979323846 (gdb) info macro M_PI Defined at /usr/include/math.h:311 included at /home/nick/myprog.c:4 #define M_PI 3.14159265358979323846 If gdb can expand macros using macro information from the executable (which requires knowledge of include paths and predefined macros), why can't cpp (or gcc -E) ? Nick