source.c: Use fgetc instead of getc.
authorJoel Brobecker <brobecker@gnat.com>
Thu, 9 May 2013 06:52:21 +0000 (06:52 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 9 May 2013 06:52:21 +0000 (06:52 +0000)
On AIX, getc is a macro which triggers an -Wunused-value warning.

gdb/ChangeLog:

        * source.c (forward_search_command): Replace call to getc
        by call to fgetc.
        (reverse_search_command): Likewise.

gdb/ChangeLog
gdb/source.c

index 6986d0298c057133d1f79391f3f8902fb0fd2aaf..2d1e3e1c04a57c606f75edd5127848fe94a517cc 100644 (file)
@@ -1,3 +1,9 @@
+2013-05-09  Joel Brobecker  <brobecker@adacore.com>
+
+       * source.c (forward_search_command): Replace call to getc
+       by call to fgetc.
+       (reverse_search_command): Likewise.
+
 2013-05-08  Doug Evans  <dje@google.com>
 
        * psymtab.c (expand_symtabs_matching_via_partial): Fix file name
index d816c9e4b5ae621e831bdbbbf5d5139ac8b79da3..710b90c9eb9758d5c3ae7992abaf6347d724d093 100644 (file)
@@ -1613,7 +1613,7 @@ forward_search_command (char *regex, int from_tty)
       buf = xmalloc (cursize);
       p = buf;
 
-      c = getc (stream);
+      c = fgetc (stream);
       if (c == EOF)
        break;
       do
@@ -1627,7 +1627,7 @@ forward_search_command (char *regex, int from_tty)
              cursize = newsize;
            }
        }
-      while (c != '\n' && (c = getc (stream)) >= 0);
+      while (c != '\n' && (c = fgetc (stream)) >= 0);
 
       /* Remove the \r, if any, at the end of the line, otherwise
          regular expressions that end with $ or \n won't work.  */
@@ -1698,14 +1698,14 @@ reverse_search_command (char *regex, int from_tty)
       char buf[4096];          /* Should be reasonable???  */
       char *p = buf;
 
-      c = getc (stream);
+      c = fgetc (stream);
       if (c == EOF)
        break;
       do
        {
          *p++ = c;
        }
-      while (c != '\n' && (c = getc (stream)) >= 0);
+      while (c != '\n' && (c = fgetc (stream)) >= 0);
 
       /* Remove the \r, if any, at the end of the line, otherwise
          regular expressions that end with $ or \n won't work.  */
This page took 0.030682 seconds and 4 git commands to generate.