public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/32208] New: Patch for 32158 has bad code in std::vector::_M_fill_initialize
@ 2007-06-04 18:52 mec at google dot com
2007-06-06 21:13 ` [Bug libstdc++/32208] " pinskia at gcc dot gnu dot org
2007-06-06 22:57 ` reichelt at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: mec at google dot com @ 2007-06-04 18:52 UTC (permalink / raw)
To: gcc-bugs
mec@hollerith:~/exp-43-redux$ cat vector-fill.cc
// Copyright 2007, Google Inc. All rights reserved.
// Author: mec@google.com (Michael Chastain)
#include <vector>
std::vector<int> my_vector (117);
===
mec@hollerith:~/exp-43-redux$ /home/mec/gcc-4.3-20070601/install/bin/g++ -Wall
-S vector-fill.cc
/home/mec/gcc-4.3-20070601/install/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/stl_vector.h:
In member function 'int std::vector<_Tp, _Alloc>::_M_fill_initialize(size_t,
const _Tp&) [with _Tp = int, _Alloc = std::allocator<int>]':
/home/mec/gcc-4.3-20070601/install/lib/gcc/i686-pc-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/stl_vector.h:832:
warning: control reaches end of non-void function
===
This is from:
http://gcc.gnu.org/viewcvs/trunk/libstdc%2B%2B-v3/include/bits/stl_vector.h?r1=124243&r2=125223
Trivial lack of "void".
===
Also, shouldn't there also be an error about lack of return type for
_M_fill_initialize?
--
Summary: Patch for 32158 has bad code in
std::vector::_M_fill_initialize
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mec at google dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32208
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libstdc++/32208] Patch for 32158 has bad code in std::vector::_M_fill_initialize
2007-06-04 18:52 [Bug libstdc++/32208] New: Patch for 32158 has bad code in std::vector::_M_fill_initialize mec at google dot com
@ 2007-06-06 21:13 ` pinskia at gcc dot gnu dot org
2007-06-06 22:57 ` reichelt at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-06 21:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-06-06 21:13 -------
*** This bug has been marked as a duplicate of 32233 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32208
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libstdc++/32208] Patch for 32158 has bad code in std::vector::_M_fill_initialize
2007-06-04 18:52 [Bug libstdc++/32208] New: Patch for 32158 has bad code in std::vector::_M_fill_initialize mec at google dot com
2007-06-06 21:13 ` [Bug libstdc++/32208] " pinskia at gcc dot gnu dot org
@ 2007-06-06 22:57 ` reichelt at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-06-06 22:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from reichelt at gcc dot gnu dot org 2007-06-06 22:57 -------
Just a note:
> Also, shouldn't there also be an error about lack of return type for
> _M_fill_initialize?
Well, here's the code snippet from the function grokdeclarator in decl.c
that deals with missing return types:
if (type_was_error_mark_node)
/* We've already issued an error, don't complain more. */;
else if (in_system_header || flag_ms_extensions)
/* Allow it, sigh. */;
else if (pedantic || ! is_main)
pedwarn ("ISO C++ forbids declaration of %qs with no type", name);
else
warning (OPT_Wreturn_type,
"ISO C++ forbids declaration of %qs with no type", name);
As you can see, return types may be omitted in system headers
(probably because there were too many systems with such headers around).
Otherwise you should get a diagnostic.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32208
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-06-06 22:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-04 18:52 [Bug libstdc++/32208] New: Patch for 32158 has bad code in std::vector::_M_fill_initialize mec at google dot com
2007-06-06 21:13 ` [Bug libstdc++/32208] " pinskia at gcc dot gnu dot org
2007-06-06 22:57 ` reichelt at gcc dot gnu dot org
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).