Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

makefile problem..

0 views
Skip to first unread message

Gerhard Harrop

unread,
Jan 24, 1995, 8:03:18 PM1/24/95
to
In <3fak5j$i...@newstand.syr.edu> bk...@fruit.ece.syr.edu (Bo-kyun Na) writes:

> I had error message such as: Invalid subargument: -W3

> So I removed -W3 subargument; then I got such errors:

> "/include/mydef.h", line 67: illegal character: 043 (octal)

> The line 67 of mydef.h has just simple sentence, #include <mixed.h>.

Check that the #include is not indented. "#" is legal only as the first
character of a line. (If you really want to indent, you may put space
after the "#".)

As to the first problem, are you sure -W3 is a valid option to your C
compiler? It's not in my man page.

Maurizio Loreti

unread,
Jan 25, 1995, 8:24:29 AM1/25/95
to
In article <D2xs9...@sed.csc.com>, gha...@sed.csc.com (Gerhard Harrop) writes:
> ...

> Check that the #include is not indented. "#" is legal only as the first
> character of a line. (If you really want to indent, you may put space
> after the "#".)

Are you sure? I don't have here K&R, or ANSI; but I remember that a
# for preprocessor directives is valid if it is the first non-whitespace
character in a statement. Has somebody a K&R handy?

Maurizio Loreti http://mvxpd5.pd.infn.it/wwwcdf/mlo.html
Un. of Padova, Dept. of Physics - Padova, Italy lor...@padova.infn.it

Larry Weiss

unread,
Jan 25, 1995, 1:34:54 PM1/25/95
to
lor...@fnalv.fnal.gov (Maurizio Loreti) writes:

>In article <D2xs9...@sed.csc.com>, gha...@sed.csc.com (Gerhard Harrop) writes:
>> ...
>> Check that the #include is not indented. "#" is legal only as the first
>> character of a line. (If you really want to indent, you may put space
>> after the "#".)

>Are you sure? I don't have here K&R, or ANSI; but I remember that a
># for preprocessor directives is valid if it is the first non-whitespace
>character in a statement. Has somebody a K&R handy?

White space is allowed before the #.

Standard clause 6.8 has this assertion:

A preprocessing directive consists of a sequence of preprocessing
tokens that begins with a # preprocessing token that is either the
first character in the source file (optionally after white space
containing no new-line characters) or that follows white space
containing at least one new-line character, and is ended by the
next new-line character.

--
Larry Weiss, l...@oc.com
214/888-0471

Peter Seebach

unread,
Jan 25, 1995, 8:22:11 PM1/25/95
to
In article <D2xs9...@sed.csc.com> gha...@sed.csc.com (Gerhard Harrop) writes:
>Check that the #include is not indented. "#" is legal only as the first
>character of a line. (If you really want to indent, you may put space
>after the "#".)

This is wrong. It *was* true. Long ago, before ANSI.

All ANSI says is that preprocessor commands consist of arbitrary whitespace,
and the sequence of tokens '#', some-preprocessor-word, and appropriate
arguments. It is required that the # be the first non-whitespace character
since the last newline.

>As to the first problem, are you sure -W3 is a valid option to your C
>compiler? It's not in my man page.

It may or may not be; these things vary.

-seebs
--
Peter Seebach - se...@solutions.solon.com -- se...@intran.xerox.com
C/Unix proto-wizard -- C/Unix questions? Send mail for help.
I'm broke! Send me gifts. Not tax-deductible.

Dan Pop

unread,
Jan 26, 1995, 5:14:03 PM1/26/95
to
In <1995Jan2...@fnalv.fnal.gov> lor...@fnalv.fnal.gov (Maurizio Loreti) writes:

>In article <D2xs9...@sed.csc.com>, gha...@sed.csc.com (Gerhard Harrop) writes:
>> ...
>> Check that the #include is not indented. "#" is legal only as the first
>> character of a line. (If you really want to indent, you may put space
>> after the "#".)
>
>Are you sure? I don't have here K&R, or ANSI; but I remember that a
># for preprocessor directives is valid if it is the first non-whitespace
>character in a statement. Has somebody a K&R handy?

You're right, but only for ANSI compilers. A K&R compiler may or may
not accept whitespace before the '#'. Even more, the same compiler can
behave differently in ANSI vs K&R modes:

ues5:~/tmp 228> cat c.c
#include <stdio.h>
FILE *fp;
ues5:~/tmp 229> cc -c c.c
/usr/lib/cmplrs/cc/cfe: Warning: c.c, line 1: Unknown Control Statement
#include <stdio.h>
-^
/usr/lib/cmplrs/cc/cfe: Error: c.c, line 2: Syntax Error
FILE *fp;
-----^
ues5:~/tmp 230> cc -c -std1 c.c
ues5:~/tmp 231>

The first cc command invokes the compiler in "extended" K&R mode, while
the second asks for strict ANSI.

Dan
--
Dan Pop
CERN, CN Division
Email: dan...@cernapo.cern.ch
Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland

0 new messages