This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH Replace index() with strchr() in read-rtl.c


Not all platforms (such as MinGW) have index() used in read-rtl.c,
causing a bootstrap failure on these targets.  index() is not in
Standard C, and POSIX recommends that strchr() (which is in Standard C)
be used instead.

I don't have CVS access.

2004-09-12  Aaron W. LaFramboise <aaronavay62@aaronwl.com>

	* read-rtl.c (apply_macro_to_string): Replace index with strchr.

Index: gcc/gcc/read-rtl.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/read-rtl.c,v
retrieving revision 1.31
diff -c -3 -p -r1.31 read-rtl.c
*** gcc/gcc/read-rtl.c	31 Aug 2004 07:00:15 -0000	1.31
--- gcc/gcc/read-rtl.c	11 Sep 2004 23:47:34 -0000
*************** apply_macro_to_string (const char *strin
*** 245,257 ****
      return string;

    base = p = copy = ASTRDUP (string);
!   while ((start = index (p, '<')) && (end = index (start, '>')))
      {
        p = start + 1;

        /* If there's a "macro:" prefix, check whether the macro name
matches.
  	 Set ATTR to the start of the attribute name.  */
!       attr = index (p, ':');
        if (attr == 0 || attr > end)
  	attr = p;
        else
--- 245,257 ----
      return string;

    base = p = copy = ASTRDUP (string);
!   while ((start = strchr (p, '<')) && (end = strchr (start, '>')))
      {
        p = start + 1;

        /* If there's a "macro:" prefix, check whether the macro name
matches.
  	 Set ATTR to the start of the attribute name.  */
!       attr = strchr (p, ':');
        if (attr == 0 || attr > end)
  	attr = p;
        else


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]