[comp.std.c] Imake question

manoj@hpldsla.sid.hp.com (Manoj Joshi) (04/19/91)

Question on imake:
=================

I am a new imake user. I get the following error:

file name: lineno: undefined preprocessor directive

This error is observed whenever in the include file the comment is 
preceded by /**/# to protect it from cpp.

This was according to the man page for imake.

Anyone has an idea why this error is given. I have lots of code which 
is using this /**/# convention, so there must be something to solve this.


Thanks
Manoj Joshi
manoj@hpldas5.hp.com

diamond@jit345.swstokyo.dec.com (Norman Diamond) (04/22/91)

In article <9160001@hpldsla.sid.hp.com> manoj@hpldsla.sid.hp.com (Manoj Joshi) writes:
>Question on imake:
If it were, it wouldn't belong here.  However, as a question on ANSI C...

>file name: lineno: undefined preprocessor directive
>This error is observed whenever in the include file the comment is 
>preceded by /**/# to protect it from cpp.

An ANSI compilation changes all comments to spaces before it processes
#directives.  Furthermore, an ANSI preprocessor accepts #directives that
have whitespace (including spaces, tabs, etc.) before the #.  So, your
# is not protected from an ANSI preprocessor.

>This was according to the man page for imake.
>Anyone has an idea why this error is given. I have lots of code which 
>is using this /**/# convention, so there must be something to solve this.

Use the same non-ANSI compiler that was used by the author of the imake
man page.  (This might sound cynical but it is the correct answer.)

If you're willing to edit your source code, then there are also other
correct answers.
--
Norman Diamond       diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.