www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - # line directives

↑ ↓ ← Josh Rendlesham <Josh_member pathlink.com> writes:
Is the compiler unable to handle # (instead of the full #line) line directives?

For example, the line:

# 1 "filename.m"

gives an "identifier expected" error. Once that line is removed, however, the
file compiles fine. 

Is there an option to allow for the compilation of such constructs (in my case
in the C output from an Objective-C preprocessor)?

Thanks,
Josh Rendlesham
Jun 14 2003
↑ ↓ "Walter" <walter digitalmars.com> writes:
"Josh Rendlesham" <Josh_member pathlink.com> wrote in message
news:bcgp55$1m5f$1 digitaldaemon.com...
 Is the compiler unable to handle # (instead of the full #line) line

 For example, the line:

 # 1 "filename.m"

 gives an "identifier expected" error. Once that line is removed, however,

 file compiles fine.

I think that's invalid C code.
 Is there an option to allow for the compilation of such constructs (in my

 in the C output from an Objective-C preprocessor)?

Probably the easiest way to deal with it is to run a global search/replace for "# " with "#line ".
Jun 17 2003
↑ ↓ → Josh Rendlesham <rendlesham fastmail.fm> writes:
Thanks for the reply.

Apparently the "# " null directive is supported by some preprocessors, with
it being noted in the GCC CPP docs that they support it mainly for
compatibility with older C code. 

Like you suggested, replacing all instances does seem to work quite well.

  Josh


Walter wrote:

 
 "Josh Rendlesham" <Josh_member pathlink.com> wrote in message
 news:bcgp55$1m5f$1 digitaldaemon.com...
 Is the compiler unable to handle # (instead of the full #line) line

 For example, the line:

 # 1 "filename.m"

 gives an "identifier expected" error. Once that line is removed, however,

 file compiles fine.

I think that's invalid C code.
 Is there an option to allow for the compilation of such constructs (in my

 in the C output from an Objective-C preprocessor)?

Probably the easiest way to deal with it is to run a global search/replace for "# " with "#line ".

Jun 17 2003