help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using c-macro-expand


From: Kevin Dziulko
Subject: Re: using c-macro-expand
Date: Fri, 4 Oct 2002 14:29:51 -0400 (EDT)

On Fri, 4 Oct 2002, Michael Slass wrote:

> Kevin Dziulko <dziulko@klaatu.canisius.edu> writes:
>
> >When I run to c-macro-expand command, I get the following:
> >
> >----------------------------------------
> >/* Preprocessor terminated with status 1
> >
> >   Messages from `/lib/cpp -C ':
> >
> >/lib/cpp: Command not found
> >
> >
> >*/
> >
> >Preprocessor produced no output
> >----------------------------------------
> >
> >I'm running GNU Emacs 20.2.3 (sparc-sun-solaris2.6, X toolkit).
> >I don't know what cpp -C is. Do I need to set a path to my
> >c compiler (/usr/ucb/cc) or something?
> >
> >Thanks!
> >Kevin
> >
> >
> >
>
> I think you need to customize the variable c-macro-preprocessor
>
> >From the file cmacexp.el:
>
> ,----
> | ;; If you use a preprocessor other than /lib/cpp (be careful to set a
> | ;; -C option or equivalent in order to make the preprocessor not to
> | ;; strip the comments):
> | ;;(setq c-macro-preprocessor "gpp -C")
> | ;;
> | ;; If you often use a particular set of flags:
> | ;;(setq c-macro-cppflags "-I /usr/include/local -DDEBUG"
> | ;;
> | ;; If you want the "Preprocessor arguments: " prompt:
> | ;;(setq c-macro-prompt-flag t)
> `----
>
> ,----[ C-h v c-macro-preprocessor RET ]
> | c-macro-preprocessor's value is "/lib/cpp -C"
> |
> | Documentation:
> | The preprocessor used by the cmacexp package.
> |
> | If you change this, be sure to preserve the `-C' (don't strip comments)
> | option, or to set an equivalent one.
> |
> | You can customize this variable.
> |
> | Defined in `/usr/share/emacs/21.2/lisp/progmodes/cmacexp.el'.
> `----
>
> So you do need to set it to the path to your c compiler, and include
> whatever switch is uses to indicate "preprocessor only"
>
>
>

I added to .emacs:
(setq c-macro-preprocessor "/usr/ucb/cc -C -E")

cc is the c compiler, -C for preprocessor to leave in comments, and -E to
preprocess only.  Now when I run c-macro-expand, I get error message:

Search failed: "^J??? !!! ??? start of c-macro expansion ??? !!! ???"

any ideas?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]