public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: #line directive bug
  1998-02-24 11:46 ` #line directive bug Paul Eggert
@ 1998-02-24  3:09   ` Jens Schweikhardt
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Schweikhardt @ 1998-02-24  3:09 UTC (permalink / raw)
  To: Paul Eggert; +Cc: schweikh, gcc2, egcs

Paul,

#    From: schweikh@diamant.noc.dfn.de (Jens Schweikhardt)
#    Date: 23 Feb 1998 10:08:57 GMT
#    Message-ID: <6crhrp$71$2@stuttgart.shuttle.de>
# 
#    #line 42 "foo\0bar"
# 
# Thanks for the bug report.  That "\0" causes cpp to expand __FILE__
# incorrectly, which means GCC silently generates incorrect code.
# I enclose a patch below, relative to the latest cccp.c snapshot.
 
Thanks for the quick response. I'm always impressed when I get
fixes for my bug reports the next day. The FreeBSD folks are
great as well :-)

# This patch fixes only the preprocessor.  Even with the patch, cc1 still
# outputs just "foo" for the file name in diagnostics; it should output
# "foo" followed by a NUL byte followed by "bar".  This is a bug, but
# it's a pain to fix and it's lower priority since it merely affects
# diagnostics and debugging info.  I wouldn't be surprised if most back
# ends can't handle NUL bytes in file names, as POSIX doesn't allow
# NULs in file names, so it might be best just to leave cc1 alone.

Well, I think I could live with that. Gcc was not the only compiler I
had trouble with. The Solaris SparcWorks compiler also has (another)
problem with line directives and IRIX c89 has yet another. Trying to
get someone from Sun to listen to me is a tricky excercise :-(

Thanks again for a great compiler. Keep up the good work.
I'll read you in comp.std.c.

Regards,

-- 
Jens Schweikhardt  http://www.shuttle.de/schweikh/
SIGSIG -- signature too long (core dumped)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: #line directive bug
       [not found] <6crhrp$71$2@stuttgart.shuttle.de>
@ 1998-02-24 11:46 ` Paul Eggert
  1998-02-24  3:09   ` Jens Schweikhardt
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggert @ 1998-02-24 11:46 UTC (permalink / raw)
  To: Jens Schweikhardt; +Cc: gcc2, egcs

   From: schweikh@diamant.noc.dfn.de (Jens Schweikhardt)
   Date: 23 Feb 1998 10:08:57 GMT
   Message-ID: <6crhrp$71$2@stuttgart.shuttle.de>

   #line 42 "foo\0bar"

Thanks for the bug report.  That "\0" causes cpp to expand __FILE__
incorrectly, which means GCC silently generates incorrect code.
I enclose a patch below, relative to the latest cccp.c snapshot.

This patch fixes only the preprocessor.  Even with the patch, cc1 still
outputs just "foo" for the file name in diagnostics; it should output
"foo" followed by a NUL byte followed by "bar".  This is a bug, but
it's a pain to fix and it's lower priority since it merely affects
diagnostics and debugging info.  I wouldn't be surprised if most back
ends can't handle NUL bytes in file names, as POSIX doesn't allow
NULs in file names, so it might be best just to leave cc1 alone.

1998-02-24  Paul Eggert  <eggert@twinsun.com>

	* cccp.c: Fix bugs relating to NUL in input file name,
	e.g. with `#line 2 "x\0y"'.

	(PRINTF_PROTO_4): New macro.
	(struct file_buf): New member nominal_fname_len.
	(struct definition): New member file_len.
	(struct if_stack): New member fname_len.

	(main, expand_to_temp_buffer, finclude, create_definition, do_line,
	conditional_skip, skip_if_group, macroexpand, make_definition,
	make_undef, make_assertion): Store length of input file names.

	(special_symbol, do_include, do_define, do_elif, do_else,
	output_line_directive, verror, error_from_errno, vwarning,
	verror_with_line, vwarning_with_line, pedwarn_with_file_and_line,
	print_containing_files): Use stored length of input file names, to
	allow embedded NUL bytes.

	(do_line): Fix off-by-1 problem: 1 too many bytes were being allocated.

	(quote_string, pedwarn_with_file_and_line): New arg specifies length,
	to allow embedded NUL bytes.  All callers changed.

===================================================================
RCS file: cccp.c,v
retrieving revision 2.8.1.1
retrieving revision 2.8.1.2
diff -c -r2.8.1.1 -r2.8.1.2
*** cccp.c	1998/02/10 09:52:59	2.8.1.1
--- cccp.c	1998/02/24 09:58:34	2.8.1.2
***************
*** 126,131 ****
--- 126,132 ----
  #define PRINTF_PROTO_1(ARGS) PRINTF_PROTO(ARGS, 1, 2)
  #define PRINTF_PROTO_2(ARGS) PRINTF_PROTO(ARGS, 2, 3)
  #define PRINTF_PROTO_3(ARGS) PRINTF_PROTO(ARGS, 3, 4)
+ #define PRINTF_PROTO_4(ARGS) PRINTF_PROTO(ARGS, 4, 5)
  
  /* VMS-specific definitions */
  #ifdef VMS
***************
*** 406,411 ****
--- 407,414 ----
    char *fname;
    /* Filename specified with #line directive.  */
    char *nominal_fname;
+   /* The length of nominal_fname, which may contain embedded NULs.  */
+   size_t nominal_fname_len;
    /* Include file description.  */
    struct include_file *inc;
    /* Record where in the search path this file was found.
***************
*** 644,649 ****
--- 647,653 ----
    U_CHAR *expansion;
    int line;			/* Line number of definition */
    char *file;			/* File of definition */
+   size_t file_len;		/* Length of file (which can contain NULs) */
    char rest_args;		/* Nonzero if last arg. absorbs the rest */
    struct reflist {
      struct reflist *next;
***************
*** 949,954 ****
--- 953,959 ----
  struct if_stack {
    struct if_stack *next;	/* for chaining to the next stack frame */
    char *fname;		/* copied from input when frame is made */
+   size_t fname_len;		/* similarly */
    int lineno;			/* similarly */
    int if_succeeded;		/* true if a leg of this if-group
  				    has been passed through rescan */
***************
*** 1048,1054 ****
  
  static U_CHAR *skip_to_end_of_comment PROTO((FILE_BUF *, int *, int));
  static U_CHAR *skip_quoted_string PROTO((U_CHAR *, U_CHAR *, int, int *, int *, int *));
! static char *quote_string PROTO((char *, char *));
  static U_CHAR *skip_paren_group PROTO((FILE_BUF *));
  
  /* Last arg to output_line_directive.  */
--- 1053,1059 ----
  
  static U_CHAR *skip_to_end_of_comment PROTO((FILE_BUF *, int *, int));
  static U_CHAR *skip_quoted_string PROTO((U_CHAR *, U_CHAR *, int, int *, int *, int *));
! static char *quote_string PROTO((char *, char *, size_t));
  static U_CHAR *skip_paren_group PROTO((FILE_BUF *));
  
  /* Last arg to output_line_directive.  */
***************
*** 1078,1084 ****
  static void warning_with_line PRINTF_PROTO_2((int, char *, ...));
  void pedwarn PRINTF_PROTO_1((char *, ...));
  void pedwarn_with_line PRINTF_PROTO_2((int, char *, ...));
! static void pedwarn_with_file_and_line PRINTF_PROTO_3((char *, int, char *, ...));
  
  static void print_containing_files PROTO((void));
  
--- 1083,1089 ----
  static void warning_with_line PRINTF_PROTO_2((int, char *, ...));
  void pedwarn PRINTF_PROTO_1((char *, ...));
  void pedwarn_with_line PRINTF_PROTO_2((int, char *, ...));
! static void pedwarn_with_file_and_line PRINTF_PROTO_4((char *, size_t, int, char *, ...));
  
  static void print_containing_files PROTO((void));
  
***************
*** 1717,1722 ****
--- 1722,1728 ----
    if (in_fname == NULL)
      in_fname = "";
    fp->nominal_fname = fp->fname = in_fname;
+   fp->nominal_fname_len = strlen (in_fname);
    fp->lineno = 0;
  
    /* In C++, wchar_t is a distinct basic type, and we can expect
***************
*** 2081,2086 ****
--- 2087,2093 ----
    if (fstat (f, &st) != 0)
      pfatal_with_name (in_fname);
    fp->nominal_fname = fp->fname = in_fname;
+   fp->nominal_fname_len = strlen (in_fname);
    fp->lineno = 1;
    fp->system_header_p = 0;
    /* JF all this is mine about reading pipes and ttys */
***************
*** 3517,3522 ****
--- 3524,3530 ----
    ip = &instack[indepth];
    ip->fname = 0;
    ip->nominal_fname = 0;
+   ip->nominal_fname_len = 0;
    ip->inc = 0;
    ip->system_header_p = 0;
    ip->macro = 0;
***************
*** 4026,4041 ****
    case T_FILE:
    case T_BASE_FILE:
      {
!       char *string;
!       if (hp->type == T_FILE)
! 	string = ip->nominal_fname;
!       else
! 	string = instack[0].nominal_fname;
  
        if (string)
  	{
! 	  buf = (char *) alloca (3 + 4 * strlen (string));
! 	  quote_string (buf, string);
  	}
        else
  	buf = "\"\"";
--- 4034,4047 ----
    case T_FILE:
    case T_BASE_FILE:
      {
!       FILE_BUF *p = hp->type == T_FILE ? ip : &instack[0];
!       char *string = p->nominal_fname;
  
        if (string)
  	{
! 	  size_t string_len = p->nominal_fname_len;
! 	  buf = (char *) alloca (3 + 4 * string_len);
! 	  quote_string (buf, string, string_len);
  	}
        else
  	buf = "\"\"";
***************
*** 4289,4295 ****
  	    /* Found a named file.  Figure out dir of the file,
  	       and put it in front of the search list.  */
  	    dsp = ((struct file_name_list *)
! 		   alloca (sizeof (struct file_name_list) + strlen (nam)));
  	    strcpy (dsp->fname, nam);
  	    simplify_filename (dsp->fname);
  	    nam = base_name (dsp->fname);
--- 4295,4302 ----
  	    /* Found a named file.  Figure out dir of the file,
  	       and put it in front of the search list.  */
  	    dsp = ((struct file_name_list *)
! 		   alloca (sizeof (struct file_name_list)
! 			   + fp->nominal_fname_len));
  	    strcpy (dsp->fname, nam);
  	    simplify_filename (dsp->fname);
  	    nam = base_name (dsp->fname);
***************
*** 5039,5044 ****
--- 5046,5052 ----
    fp = &instack[indepth + 1];
    bzero ((char *) fp, sizeof (FILE_BUF));
    fp->nominal_fname = fp->fname = fname;
+   fp->nominal_fname_len = strlen (fname);
    fp->inc = inc;
    fp->length = 0;
    fp->lineno = 1;
***************
*** 5426,5432 ****
  				     line_directive_len *= 2);
  	sprintf (line_directive, "\n# %d ", next_string->lineno);
  	strcpy (quote_string (line_directive + strlen (line_directive),
! 			      (char *) next_string->filename),
  		"\n");
  	safe_write (fileno (stdout), line_directive, strlen (line_directive));
  	safe_write (fileno (stdout),
--- 5434,5441 ----
  				     line_directive_len *= 2);
  	sprintf (line_directive, "\n# %d ", next_string->lineno);
  	strcpy (quote_string (line_directive + strlen (line_directive),
! 			      (char *) next_string->filename,
! 			      strlen ((char *) next_string->filename)),
  		"\n");
  	safe_write (fileno (stdout), line_directive, strlen (line_directive));
  	safe_write (fileno (stdout),
***************
*** 5508,5513 ****
--- 5517,5523 ----
    int sym_length;		/* and how long it is */
    int line = instack[indepth].lineno;
    char *file = instack[indepth].nominal_fname;
+   size_t file_len = instack[indepth].nominal_fname_len;
    int rest_args = 0;
  
    DEFINITION *defn;
***************
*** 5655,5660 ****
--- 5665,5671 ----
  
    defn->line = line;
    defn->file = file;
+   defn->file_len = file_len;
  
    /* OP is null if this is a predefinition */
    defn->predefined = !op;
***************
*** 5715,5721 ****
  
  	pedwarn ("`%.*s' redefined", mdef.symlen, mdef.symnam);
  	if (hp->type == T_MACRO)
! 	  pedwarn_with_file_and_line (hp->value.defn->file, hp->value.defn->line,
  				      "this is the location of the previous definition");
        }
        /* Replace the old definition.  */
--- 5726,5734 ----
  
  	pedwarn ("`%.*s' redefined", mdef.symlen, mdef.symnam);
  	if (hp->type == T_MACRO)
! 	  pedwarn_with_file_and_line (hp->value.defn->file,
! 				      hp->value.defn->file_len,
! 				      hp->value.defn->line,
  				      "this is the location of the previous definition");
        }
        /* Replace the old definition.  */
***************
*** 6628,6634 ****
  	break;
  
        case '\"':
! 	p[-1] = 0;
  	goto fname_done;
        }
    fname_done:
--- 6641,6647 ----
  	break;
  
        case '\"':
! 	*--p = 0;
  	goto fname_done;
        }
    fname_done:
***************
*** 6674,6679 ****
--- 6687,6693 ----
        if (hp->length == fname_length &&
  	  bcmp (hp->value.cpval, fname, fname_length) == 0) {
  	ip->nominal_fname = hp->value.cpval;
+ 	ip->nominal_fname_len = fname_length;
  	break;
        }
      if (hp == 0) {
***************
*** 6682,6690 ****
        hp->next = *hash_bucket;
        *hash_bucket = hp;
  
-       hp->length = fname_length;
        ip->nominal_fname = hp->value.cpval = ((char *) hp) + sizeof (HASHNODE);
!       bcopy (fname, hp->value.cpval, fname_length);
      }
    } else if (*bp) {
      error ("invalid format `#line' directive");
--- 6696,6704 ----
        hp->next = *hash_bucket;
        *hash_bucket = hp;
  
        ip->nominal_fname = hp->value.cpval = ((char *) hp) + sizeof (HASHNODE);
!       ip->nominal_fname_len = hp->length = fname_length;
!       bcopy (fname, hp->value.cpval, fname_length + 1);
      }
    } else if (*bp) {
      error ("invalid format `#line' directive");
***************
*** 6953,6961 ****
      if (if_stack->type != T_IF && if_stack->type != T_ELIF) {
        error ("`#elif' after `#else'");
        fprintf (stderr, " (matches line %d", if_stack->lineno);
!       if (if_stack->fname != NULL && ip->fname != NULL
! 	  && strcmp (if_stack->fname, ip->nominal_fname) != 0)
! 	fprintf (stderr, ", file %s", if_stack->fname);
        fprintf (stderr, ")\n");
      }
      if_stack->type = T_ELIF;
--- 6967,6979 ----
      if (if_stack->type != T_IF && if_stack->type != T_ELIF) {
        error ("`#elif' after `#else'");
        fprintf (stderr, " (matches line %d", if_stack->lineno);
!       if (! (if_stack->fname_len == ip->nominal_fname_len
! 	     && !bcmp (if_stack->fname, ip->nominal_fname,
! 		       if_stack->fname_len))) {
! 	fprintf (stderr, ", file ");
! 	fwrite (if_stack->fname, sizeof if_stack->fname[0],
! 		if_stack->fname_len, stderr);
!       }
        fprintf (stderr, ")\n");
      }
      if_stack->type = T_ELIF;
***************
*** 7115,7120 ****
--- 7133,7139 ----
  
    temp = (IF_STACK_FRAME *) xcalloc (1, sizeof (IF_STACK_FRAME));
    temp->fname = ip->nominal_fname;
+   temp->fname_len = ip->nominal_fname_len;
    temp->lineno = ip->lineno;
    temp->next = if_stack;
    temp->control_macro = control_macro;
***************
*** 7389,7394 ****
--- 7408,7414 ----
  	    if_stack = temp;
  	    temp->lineno = ip->lineno;
  	    temp->fname = ip->nominal_fname;
+ 	    temp->fname_len = ip->nominal_fname_len;
  	    temp->type = kt->type;
  	    break;
  	  case T_ELSE:
***************
*** 7490,7497 ****
      if (if_stack->type != T_IF && if_stack->type != T_ELIF) {
        error ("`#else' after `#else'");
        fprintf (stderr, " (matches line %d", if_stack->lineno);
!       if (strcmp (if_stack->fname, ip->nominal_fname) != 0)
! 	fprintf (stderr, ", file %s", if_stack->fname);
        fprintf (stderr, ")\n");
      }
      if_stack->type = T_ELSE;
--- 7510,7522 ----
      if (if_stack->type != T_IF && if_stack->type != T_ELIF) {
        error ("`#else' after `#else'");
        fprintf (stderr, " (matches line %d", if_stack->lineno);
!       if (! (if_stack->fname_len == ip->nominal_fname_len
! 	     && !bcmp (if_stack->fname, ip->nominal_fname,
! 		       if_stack->fname_len))) {
! 	fprintf (stderr, ", file ");
! 	fwrite (if_stack->fname, sizeof if_stack->fname[0],
! 		if_stack->fname_len, stderr);
!       }
        fprintf (stderr, ")\n");
      }
      if_stack->type = T_ELSE;
***************
*** 7784,7799 ****
  }
  
  /* Place into DST a quoted string representing the string SRC.
     Return the address of DST's terminating null.  */
  
  static char *
! quote_string (dst, src)
       char *dst, *src;
  {
    U_CHAR c;
  
    *dst++ = '\"';
!   for (;;)
      switch ((c = *src++))
        {
        default:
--- 7809,7827 ----
  }
  
  /* Place into DST a quoted string representing the string SRC.
+    SRCLEN is the length of SRC; SRC may contain null bytes.
     Return the address of DST's terminating null.  */
  
  static char *
! quote_string (dst, src, srclen)
       char *dst, *src;
+      size_t srclen;
  {
    U_CHAR c;
+   char *srclim = src + srclen;
  
    *dst++ = '\"';
!   while (src != srclim)
      switch ((c = *src++))
        {
        default:
***************
*** 7811,7822 ****
  	*dst++ = '\\';
  	*dst++ = c;
  	break;
-       
-       case '\0':
- 	*dst++ = '\"';
- 	*dst = '\0';
- 	return dst;
        }
  }
  
  /* Skip across a group of balanced parens, starting from IP->bufp.
--- 7839,7849 ----
  	*dst++ = '\\';
  	*dst++ = c;
  	break;
        }
+       
+   *dst++ = '\"';
+   *dst = '\0';
+   return dst;
  }
  
  /* Skip across a group of balanced parens, starting from IP->bufp.
***************
*** 7915,7924 ****
      ip->bufp++;
    }
  
!   line_directive_buf = (char *) alloca (4 * strlen (ip->nominal_fname) + 100);
    sprintf (line_directive_buf, "# %d ", ip->lineno);
    line_end = quote_string (line_directive_buf + strlen (line_directive_buf),
! 			   ip->nominal_fname);
    if (file_change != same_file) {
      *line_end++ = ' ';
      *line_end++ = file_change == enter_file ? '1' : '2';
--- 7942,7951 ----
      ip->bufp++;
    }
  
!   line_directive_buf = (char *) alloca (4 * ip->nominal_fname_len + 100);
    sprintf (line_directive_buf, "# %d ", ip->lineno);
    line_end = quote_string (line_directive_buf + strlen (line_directive_buf),
! 			   ip->nominal_fname, ip->nominal_fname_len);
    if (file_change != same_file) {
      *line_end++ = ' ';
      *line_end++ = file_change == enter_file ? '1' : '2';
***************
*** 8343,8348 ****
--- 8370,8376 ----
  
      ip2->fname = 0;
      ip2->nominal_fname = 0;
+     ip2->nominal_fname_len = 0;
      ip2->inc = 0;
      /* This may not be exactly correct, but will give much better error
         messages for nested macro calls than using a line number of zero.  */
***************
*** 8831,8838 ****
        break;
      }
  
!   if (ip != NULL)
!     fprintf (stderr, "%s:%d: ", ip->nominal_fname, ip->lineno);
    vfprintf (stderr, msg, args);
    fprintf (stderr, "\n");
    errors++;
--- 8859,8869 ----
        break;
      }
  
!   if (ip != NULL) {
!     fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0],
! 	    ip->nominal_fname_len, stderr);
!     fprintf (stderr, ":%d: ", ip->lineno);
!   }
    vfprintf (stderr, msg, args);
    fprintf (stderr, "\n");
    errors++;
***************
*** 8855,8862 ****
        break;
      }
  
!   if (ip != NULL)
!     fprintf (stderr, "%s:%d: ", ip->nominal_fname, ip->lineno);
  
    fprintf (stderr, "%s: %s\n", name, my_strerror (errno));
  
--- 8886,8896 ----
        break;
      }
  
!   if (ip != NULL) {
!     fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0],
! 	    ip->nominal_fname_len, stderr);
!     fprintf (stderr, ":%d: ", ip->lineno);
!   }
  
    fprintf (stderr, "%s: %s\n", name, my_strerror (errno));
  
***************
*** 8898,8905 ****
        break;
      }
  
!   if (ip != NULL)
!     fprintf (stderr, "%s:%d: ", ip->nominal_fname, ip->lineno);
    fprintf (stderr, "warning: ");
    vfprintf (stderr, msg, args);
    fprintf (stderr, "\n");
--- 8932,8942 ----
        break;
      }
  
!   if (ip != NULL) {
!     fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0],
! 	    ip->nominal_fname_len, stderr);
!     fprintf (stderr, ":%d: ", ip->lineno);
!   }
    fprintf (stderr, "warning: ");
    vfprintf (stderr, msg, args);
    fprintf (stderr, "\n");
***************
*** 8938,8945 ****
        break;
      }
  
!   if (ip != NULL)
!     fprintf (stderr, "%s:%d: ", ip->nominal_fname, line);
    vfprintf (stderr, msg, args);
    fprintf (stderr, "\n");
    errors++;
--- 8975,8985 ----
        break;
      }
  
!   if (ip != NULL) {
!     fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0],
! 	    ip->nominal_fname_len, stderr);
!     fprintf (stderr, ":%d: ", line);
!   }
    vfprintf (stderr, msg, args);
    fprintf (stderr, "\n");
    errors++;
***************
*** 8984,8991 ****
        break;
      }
  
!   if (ip != NULL)
!     fprintf (stderr, line ? "%s:%d: " : "%s: ", ip->nominal_fname, line);
    fprintf (stderr, "warning: ");
    vfprintf (stderr, msg, args);
    fprintf (stderr, "\n");
--- 9024,9034 ----
        break;
      }
  
!   if (ip != NULL) {
!     fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0],
! 	    ip->nominal_fname_len, stderr);
!     fprintf (stderr, line ? ":%d: " : ": ", line);
!   }
    fprintf (stderr, "warning: ");
    vfprintf (stderr, msg, args);
    fprintf (stderr, "\n");
***************
*** 9031,9040 ****
  
  static void
  #if defined (__STDC__) && defined (HAVE_VPRINTF)
! pedwarn_with_file_and_line (char *file, int line, PRINTF_ALIST (msg))
  #else
! pedwarn_with_file_and_line (file, line, PRINTF_ALIST (msg))
       char *file;
       int line;
       PRINTF_DCL (msg)
  #endif
--- 9074,9085 ----
  
  static void
  #if defined (__STDC__) && defined (HAVE_VPRINTF)
! pedwarn_with_file_and_line (char *file, size_t file_len, int line,
! 			    PRINTF_ALIST (msg))
  #else
! pedwarn_with_file_and_line (file, file_len, line, PRINTF_ALIST (msg))
       char *file;
+      size_t file_len;
       int line;
       PRINTF_DCL (msg)
  #endif
***************
*** 9043,9050 ****
  
    if (!pedantic_errors && inhibit_warnings)
      return;
!   if (file != NULL)
!     fprintf (stderr, "%s:%d: ", file, line);
    if (pedantic_errors)
      errors++;
    if (!pedantic_errors)
--- 9088,9097 ----
  
    if (!pedantic_errors && inhibit_warnings)
      return;
!   if (file) {
!     fwrite (file, sizeof file[0], file_len, stderr);
!     fprintf (stderr, ":%d: ", line);
!   }
    if (pedantic_errors)
      errors++;
    if (!pedantic_errors)
***************
*** 9091,9097 ****
  	fprintf (stderr, ",\n                ");
        }
  
!       fprintf (stderr, " from %s:%d", ip->nominal_fname, ip->lineno);
      }
    if (! first)
      fprintf (stderr, ":\n");
--- 9138,9147 ----
  	fprintf (stderr, ",\n                ");
        }
  
!       fprintf (stderr, " from ");
!       fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0],
! 	      ip->nominal_fname_len, stderr);
!       fprintf (stderr, ":%d", ip->lineno);
      }
    if (! first)
      fprintf (stderr, ":\n");
***************
*** 9710,9715 ****
--- 9760,9766 ----
    
    ip = &instack[++indepth];
    ip->nominal_fname = ip->fname = "*Initialization*";
+   ip->nominal_fname_len = strlen (ip->nominal_fname);
  
    ip->buf = ip->bufp = buf;
    ip->length = strlen ((char *) buf);
***************
*** 9739,9744 ****
--- 9790,9796 ----
  
    ip = &instack[++indepth];
    ip->nominal_fname = ip->fname = "*undef*";
+   ip->nominal_fname_len = strlen (ip->nominal_fname);
  
    ip->buf = ip->bufp = (U_CHAR *) str;
    ip->length = strlen (str);
***************
*** 9795,9800 ****
--- 9847,9853 ----
    
    ip = &instack[++indepth];
    ip->nominal_fname = ip->fname = "*Initialization*";
+   ip->nominal_fname_len = strlen (ip->nominal_fname);
  
    ip->buf = ip->bufp = buf;
    ip->length = strlen ((char *) buf);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-02-24 11:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <6crhrp$71$2@stuttgart.shuttle.de>
1998-02-24 11:46 ` #line directive bug Paul Eggert
1998-02-24  3:09   ` Jens Schweikhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).