compiler not very tolerant of spacing

the new gnu compiler in nto (vs watcom) is not very tolerant of spacing.

Both of the following constructs have given me parsing errors when
compiling under NTO:

  1. #include < time.h > does not work. It must be #include <time.h> (no
    spaces in < >'s)

  2. a stray space or so after a continuation character breaks the
    continuation

Both of these worked fine in the watcom compiler under QNX4. Are there
more I should watch for?

Scott

You should also watch for dos line breaks - these will upset
the preprocessor.

J. Scott Franko <jsfranko@switch.com> wrote:

the new gnu compiler in nto (vs watcom) is not very tolerant of spacing.

Both of the following constructs have given me parsing errors when
compiling under NTO:

  1. #include < time.h > does not work. It must be #include <time.h> (no
    spaces in < >'s)

  2. a stray space or so after a continuation character breaks the
    continuation

Both of these worked fine in the watcom compiler under QNX4. Are there
more I should watch for?

Scott


cburgess@qnx.com

In article <39DE2990.7574F2A2@switch.com>,
J. Scott Franko <jsfranko@switch.com> wrote:

the new gnu compiler in nto (vs watcom) is not very tolerant of spacing.

Both of the following constructs have given me parsing errors when
compiling under NTO:

  1. #include < time.h > does not work. It must be #include <time.h> (no
    spaces in < >'s)

No offense, but this is the same as saying:

open(" time.h ", …)

Should open the file “time.h”, when it really won’t. What is between
the angle brackets is a file name. File names can have whitespace in
them, that’s why delimiters are important.


  1. a stray space or so after a continuation character breaks the
    continuation

The \ character is not a continuation character. It is an escape
character. The only reason it works as a continuation is because
it immediately precedes the \n character, escaping it. If there
is any whitespace following the \ it escapes that whitespace character
only.

Both of these worked fine in the watcom compiler under QNX4. Are there
more I should watch for?

Steve Furr email: furr@qnx.com
QNX Software Systems, Ltd.

Steve Furr wrote:

In article <> 39DE2990.7574F2A2@switch.com> >,
J. Scott Franko <> jsfranko@switch.com> > wrote:
the new gnu compiler in nto (vs watcom) is not very tolerant of spacing.

Both of the following constructs have given me parsing errors when
compiling under NTO:

  1. #include < time.h > does not work. It must be #include <time.h> (no
    spaces in < >'s)

No offense, but this is the same as saying:

No offense taken. It’s not my code. I’m just porting it from watcom on QNX4
to gnu on QRTP.

open(" time.h ", …)

Should open the file “time.h”, when it really won’t. What is between
the angle brackets is a file name. File names can have whitespace in
them, that’s why delimiters are important.

sure that makes sense. My only comment is that watcom compiler didn’t
complain, and compilers are generally space tolerant.

  1. a stray space or so after a continuation character breaks the
    continuation

The \ character is not a continuation character. It is an escape
character. The only reason it works as a continuation is because
it immediately precedes the \n character, escaping it. If there
is any whitespace following the \ it escapes that whitespace character
only.

What is it escaping when it is the continuation character? Is it really
escaping? Or does the symbol have a dual purpose in life?

Both of these worked fine in the watcom compiler under QNX4. Are there
more I should watch for?

\


Steve Furr email: > furr@qnx.com
QNX Software Systems, Ltd.