Author: adrian
Date: Thu Apr 16 23:31:39 2020
New Revision: 360028
URL: https://svnweb.freebsd.org/changeset/base/360028

Log:
  [sh] Fix a "may be unused" warning on mips-gcc
  
  mips-gcc for mips32 was complaining that c was potentially used before
  being set.  Setting it to 0 before calling fdgetsc() looks like the right
  thing to do in this instance; there's an explicit check for c == 0 later
  on.
  
  Tested: mips-gcc mips32 build, running /bin/sh on mips32

Modified:
  head/bin/sh/miscbltin.c

Modified: head/bin/sh/miscbltin.c
==============================================================================
--- head/bin/sh/miscbltin.c     Thu Apr 16 23:29:49 2020        (r360027)
+++ head/bin/sh/miscbltin.c     Thu Apr 16 23:31:39 2020        (r360028)
@@ -245,6 +245,7 @@ readcmd(int argc __unused, char **argv __unused)
        lastnonifs = lastnonifsws = -1;
        fdctx_init(STDIN_FILENO, &fdctx);
        for (;;) {
+               c = 0;
                nread = fdgetc(&fdctx, &c);
                if (nread == -1) {
                        if (errno == EINTR) {
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to