Hi Neil,

If the following condition is met, line_comment_chars consists of just "#":

#if (defined (TE_I386AIX)                               \
     || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \
         && !defined (TE_LINUX)                         \
         && !defined (TE_NETWARE)                       \
         && !defined (TE_FreeBSD)                       \
         && !defined (TE_NetBSD)))

The problem can be seen with the i386-elf-as cross assembler from the
DarwinPorts i386-elf-binutils package on MacOS X on an Intel Mac (and I presume
on a PowerPC Mac too). I can reproduce the problem with a file called test.S
consisting of just these two lines:

Hmm - I think that those sources must be different from the official binutils sources. In our sources the above piece of code looks like this:
--------------------------------------------------------------------
#if (defined (TE_I386AIX)                               \
     || ((defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) \
         && !defined (TE_GNU)                           \
         && !defined (TE_LINUX)                         \
         && !defined (TE_NETWARE)                       \
         && !defined (TE_FreeBSD)                       \
         && !defined (TE_NetBSD)))
/* This array holds the chars that always start a comment.  If the
   pre-processor is disabled, these aren't very useful.  The option
   --divide will remove '/' from this list.  */
const char *i386_comment_chars = "#/";
#define SVR4_COMMENT_CHARS 1
#define PREFIX_SEPARATOR '\\'

#else
const char *i386_comment_chars = "#";
#define PREFIX_SEPARATOR '/'
#endif

/* This array holds the chars that only start a comment at the beginning of
   a line.  If the line seems to have the form '# 123 filename'
   .line and .file directives will appear in the pre-processed output.
   Note that input_file.c hand checks for '#' at the beginning of the
   first line of the input file.  This is because the compiler outputs
   #NO_APP at the beginning of its output.
   Also note that comments started like this one will always work if
   '/' isn't otherwise defined.  */
const char line_comment_chars[] = "#/";
--------------------------------------------------------------------

So line_comment_chars always contains a forward slash, regardless of the settings of any defined constants.

I think that you may need to report this problem to the Darwin developers.

Cheers
  Nick




_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to