public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* clang -Wparentheses warnings on gdb-7.9
@ 2015-02-27 18:44 Jack Howarth
  0 siblings, 0 replies; only message in thread
From: Jack Howarth @ 2015-02-27 18:44 UTC (permalink / raw)
  To: gdb

    We have quite a few warnings reported in the build of gdb-7.9
reported from clang on -Wparentheses.

complete.c:1002:23: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
      while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))
             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
complete.c:1002:23: note: place parentheses around the assignment to
silence this warning
      while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))
                      ^
             (                                                             )
complete.c:1002:23: note: use '==' to turn this assignment into an
equality comparison
      while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY))
                      ^
                      ==
complete.c:2010:17: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
  while (string = (*entry_function) (text, matches))
         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
complete.c:2010:17: note: place parentheses around the assignment to
silence this warning
  while (string = (*entry_function) (text, matches))
                ^
         (                                         )
complete.c:2063:16: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
  while (entry = getpwent ())
         ~~~~~~^~~~~~~~~~~~~
complete.c:2063:16: note: place parentheses around the assignment to
silence this warning
  while (entry = getpwent ())
               ^
         (                  )
complete.c:2063:16: note: use '==' to turn this assignment into an
equality comparison
  while (entry = getpwent ())
               ^
               ==
bind.c:451:21: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
  for (i = l = 0; c = seq[i]; i++)
                  ~~^~~~~~~~
bind.c:451:21: note: place parentheses around the assignment to
silence this warning
  for (i = l = 0; c = seq[i]; i++)
                    ^
                  (         )
bind.c:451:21: note: use '==' to turn this assignment into an equality
comparison
  for (i = l = 0; c = seq[i]; i++)
                    ^
                    ==
bind.c:1197:21: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
      for (i = 1; c = string[i]; i++)
                  ~~^~~~~~~~~~~
bind.c:1197:21: note: place parentheses around the assignment to
silence this warning
      for (i = 1; c = string[i]; i++)
                    ^
                  (            )
bind.c:1197:21: note: use '==' to turn this assignment into an
equality comparison
      for (i = 1; c = string[i]; i++)
                    ^
                    ==
bind.c:1288:25: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
      for (passc = 0; c = string[i]; i++)
                      ~~^~~~~~~~~~~
bind.c:1288:25: note: place parentheses around the assignment to
silence this warning
      for (passc = 0; c = string[i]; i++)
                        ^
                      (            )
bind.c:1288:25: note: use '==' to turn this assignment into an
equality comparison
      for (passc = 0; c = string[i]; i++)
                        ^
                        ==
bind.c:2117:20: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
  for (i = 0; name = names[i]; i++)
              ~~~~~^~~~~~~~~~
bind.c:2117:20: note: place parentheses around the assignment to
silence this warning
  for (i = 0; name = names[i]; i++)
                   ^
              (              )
bind.c:2117:20: note: use '==' to turn this assignment into an
equality comparison
  for (i = 0; name = names[i]; i++)
                   ^
                   ==
nput.c:424:13: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
      if (c = _rl_next_macro_key ())
          ~~^~~~~~~~~~~~~~~~~~~~~~~
input.c:424:13: note: place parentheses around the assignment to
silence this warning
      if (c = _rl_next_macro_key ())
            ^
          (                        )
input.c:424:13: note: use '==' to turn this assignment into an
equality comparison
      if (c = _rl_next_macro_key ())
            ^
            ==
misc.c:456:14: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
      if (ul = (UNDO_LIST *)entry->data)
          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
misc.c:456:14: note: place parentheses around the assignment to
silence this warning
      if (ul = (UNDO_LIST *)entry->data)
             ^
          (                            )
misc.c:456:14: note: use '==' to turn this assignment into an equality
comparison
      if (ul = (UNDO_LIST *)entry->data)
             ^
             ==
histexpand.c:207:27: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
  for (local_index = i; c = string[i]; i++)
                        ~~^~~~~~~~~~~
histexpand.c:207:27: note: place parentheses around the assignment to
silence this warning
  for (local_index = i; c = string[i]; i++)
                          ^
                        (            )
histexpand.c:207:27: note: use '==' to turn this assignment into an
equality comparison
  for (local_index = i; c = string[i]; i++)
                          ^
                          ==
./tilde.c:199:14: note: place parentheses around the assignment to
silence this warning
  if (result = strchr (string, '~'))
             ^
      (                            )
./tilde.c:199:14: note: use '==' to turn this assignment into an
equality comparison
  if (result = strchr (string, '~'))
             ^
             ==

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-27 18:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-27 18:44 clang -Wparentheses warnings on gdb-7.9 Jack Howarth

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).