unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Eli Zaretskii" <eliz@gnu.org>
Cc: nickrob@snap.net.nz, emacs-devel@gnu.org
Subject: Re: /lib/cpp not found in c-mode
Date: Fri, 06 May 2005 10:43:41 +0300	[thread overview]
Message-ID: <01c5520f$Blat.v2.4$77c7d860@zahav.net.il> (raw)
In-Reply-To: <966E6F20-E10E-43E5-8E4F-A9C1043E6D47@swipnet.se> (jan.h.d@swipnet.se)

> From: "Jan D." <jan.h.d@swipnet.se>
> Date: Fri, 6 May 2005 06:51:38 +0200
> Cc: emacs-devel@gnu.org
> 
> gcc -E can expand the macros just fine, it just needs the same input  
> (-I -D and -U) as gcc got when creating the executable.  As others  
> pointed out, it is impractical to set this up if you are working on  
> several different projects at once.

It is not impractical, since I actually do this in practice.  One way
to overcome the difficulties is to use the command history features
offered by Emacs.

Also, I really doubt that many people work ``on several different
projects at once'', literally.  I think it's an exaggeration, and that
even if someone works on several projects, they don't switch from one
project to another every minute, at least not in most cases, and
neither do they need to use c-macro-expand all the time (see below).

> Personally I don't see the need for expanding macros.  One of the  
> reasons I use them in the first place is to hide details I don't need  
> to see.  Expanding them while editing seems a strange thing to do.

When you write your code, you don't need that.  But when you need to
understand some compiler message or obscure bug in code someone else
wrote, it is sometimes hard to get along without this feature.  A case
in point is this message that GCC would once output while compiling
regex.c:

    regex.c:5179: warning: comparison is always true due to limited range of data type

The offending line was:

		    if (RE_TRANSLATE (translate, *d) != *p++)

Let me know how much time it takes you to figure out what is the
problem without expanding the macros in this line with something like
the feature we are discussing ;-)  (It took me about 5 seconds after I
expanded them.)

Granted, this is not the most important feature for C programming, but
I wouldn't say that ``I don't see the need for expanding macros''.  So
let's keep things in perspective here, okay?

  reply	other threads:[~2005-05-06  7:43 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-01 16:47 /lib/cpp not found in c-mode Stefan Monnier
2005-05-01 20:23 ` Eli Zaretskii
2005-05-02  1:29   ` Nick Roberts
2005-05-02 15:44     ` Stefan Monnier
2005-05-02 21:30       ` Nick Roberts
2005-05-04  9:46       ` Nick Roberts
2005-05-01 23:40 ` Nick Roberts
2005-05-02  4:14   ` Jan D.
2005-05-02  6:46     ` Nick Roberts
2005-05-02 19:58       ` Jan D.
2005-05-02 21:15         ` Nick Roberts
2005-05-02 22:16           ` Stefan Monnier
2005-05-03  4:05             ` Nick Roberts
2005-05-03 15:45               ` Stefan Monnier
2005-05-03 21:36                 ` Nick Roberts
2005-05-03 17:12             ` Richard Stallman
2005-05-03 18:18               ` Stefan Monnier
     [not found]                 ` <20050503233249.1C2799F4ED@mirror.positive-internet.com>
2005-05-03 23:45                   ` Stefan Monnier
2005-05-04 22:05                     ` Richard Stallman
2005-05-04 19:04                 ` Josh Varner
2005-05-03 19:13             ` Eli Zaretskii
2005-05-03 20:23               ` Stefan Monnier
2005-05-04 20:58                 ` Eli Zaretskii
2005-05-05 10:58                   ` Nick Roberts
2005-05-05 17:43                     ` Eli Zaretskii
     [not found]                     ` <0FA9201A-8390-4924-BDE3-2857B0A33576@swipnet.se>
2005-05-05 21:54                       ` Nick Roberts
2005-05-06  4:51                         ` Jan D.
2005-05-06  7:43                           ` Eli Zaretskii [this message]
2005-05-03  4:14           ` Jan D.
2005-05-03 19:49           ` Magnus Henoch
2005-05-04 20:49             ` Nick Roberts
2005-05-05 14:17               ` Stefan Monnier
2005-05-05 17:50                 ` Eli Zaretskii
2005-05-05 18:19                   ` Stefan Monnier
2005-05-05 21:02                     ` Nick Roberts
2005-05-06 12:34                       ` Eli Zaretskii
2005-05-08  2:54                         ` Nick Roberts
2005-05-08  4:28                           ` Eli Zaretskii
2005-05-08  4:59                             ` Nick Roberts
2005-05-08 16:12                               ` Richard Stallman
2005-05-08 18:43                               ` Eli Zaretskii
2005-05-08 16:12                           ` Richard Stallman
2005-05-08 17:31                         ` Stefan Monnier
2005-05-08 19:02                           ` Eli Zaretskii
2005-05-08 19:41                             ` Eli Zaretskii
2005-05-08 21:18                             ` Stefan Monnier
2005-05-06 12:49                       ` Eli Zaretskii
2005-05-06 22:41                         ` Nick Roberts

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='01c5520f$Blat.v2.4$77c7d860@zahav.net.il' \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=nickrob@snap.net.nz \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).