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