public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/57880] New: cp/parser.c: 6 * missing break ?
@ 2013-07-11  7:39 dcb314 at hotmail dot com
  2013-07-11  9:23 ` [Bug c++/57880] " paolo.carlini at oracle dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: dcb314 at hotmail dot com @ 2013-07-11  7:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57880

            Bug ID: 57880
           Summary: cp/parser.c: 6 * missing break ?
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com

I just ran the static analysis checker "cppcheck" over the source code
of trunk 20130710. It said

Checking trunk/gcc/cp/parser.c...
[trunk/gcc/cp/parser.c:12465] -> [trunk/gcc/cp/parser.c:12468]: (warning)
Variable 'string_len' is reassigned a value before the old one has been used.
'break;' missing?
[trunk/gcc/cp/parser.c:12468] -> [trunk/gcc/cp/parser.c:12470]: (warning)
Variable 'string_len' is reassigned a value before the old one has been used.
'break;' missing?
[trunk/gcc/cp/parser.c:12508] -> [trunk/gcc/cp/parser.c:12511]: (warning)
Variable 'string_len' is reassigned a value before the old one has been used.
'break;' missing?
[trunk/gcc/cp/parser.c:12511] -> [trunk/gcc/cp/parser.c:12513]: (warning)
Variable 'string_len' is reassigned a value before the old one has been used.
'break;' missing?

Source code is

    case CPP_WSTRING_USERDEF:
      string_len = 3;
    case CPP_STRING16_USERDEF:
    case CPP_STRING32_USERDEF:
      string_len = 5;
    case CPP_UTF8STRING_USERDEF:
      string_len = 4;
      bad_encoding_prefix = true;
    case CPP_STRING_USERDEF:

Code obviously broken. Suggest rework and maybe a look at related bug # 
7652 would also help.


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

end of thread, other threads:[~2013-07-25 18:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-11  7:39 [Bug c/57880] New: cp/parser.c: 6 * missing break ? dcb314 at hotmail dot com
2013-07-11  9:23 ` [Bug c++/57880] " paolo.carlini at oracle dot com
2013-07-22  9:46 ` paolo.carlini at oracle dot com
2013-07-22 15:42 ` dcb314 at hotmail dot com
2013-07-22 15:51 ` paolo.carlini at oracle dot com
2013-07-24 14:06 ` dcb314 at hotmail dot com
2013-07-24 14:09 ` dcb314 at hotmail dot com
2013-07-24 14:47 ` redi at gcc dot gnu.org
2013-07-24 15:36 ` paolo.carlini at oracle dot com
2013-07-24 15:36 ` paolo.carlini at oracle dot com
2013-07-24 19:02 ` paolo.carlini at oracle dot com
2013-07-25 15:05 ` paolo.carlini at oracle dot com
2013-07-25 18:21 ` dcb314 at hotmail dot com
2013-07-25 18:32 ` paolo.carlini at oracle dot com

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