All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sage Weil <sage@inktank.com>
To: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH 01/15] kv_flat_btree_async.cc: use vector instead of VLA's
Date: Mon, 11 Feb 2013 05:57:20 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1302110554040.5429@cobra.newdream.net> (raw)
In-Reply-To: <5118F05D.8020304@bisect.de>

On Mon, 11 Feb 2013, Danny Al-Gaaf wrote:
> Am 10.02.2013 06:57, schrieb Sage Weil:
> > On Thu, 7 Feb 2013, Danny Al-Gaaf wrote:
> >> Fix "variable length array of non-POD element type" errors caused by
> >> using librados::ObjectWriteOperation VLAs. (-Wvla)
> >>
> >> Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
> >> ---
> >>  src/key_value_store/kv_flat_btree_async.cc | 14 +++++++-------
> >>  1 file changed, 7 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/src/key_value_store/kv_flat_btree_async.cc b/src/key_value_store/kv_flat_btree_async.cc
> >> index 96c6cb0..4342e70 100644
> >> --- a/src/key_value_store/kv_flat_btree_async.cc
> >> +++ b/src/key_value_store/kv_flat_btree_async.cc
> >> @@ -1119,9 +1119,9 @@ int KvFlatBtreeAsync::cleanup(const index_data &idata, const int &errno) {
> >>      //all changes were created except for updating the index and possibly
> >>      //deleting the objects. roll forward.
> >>      vector<pair<pair<int, string>, librados::ObjectWriteOperation*> > ops;
> >> -    librados::ObjectWriteOperation owos[idata.to_delete.size() + 1];
> >> +    vector<librados::ObjectWriteOperation*> owos(idata.to_delete.size() + 1);
> > 
> > I haven't read much of the surrounding code, but from what is included 
> > here I don't think this is equivalent... these are just null pointers 
> > initially, and so
> > 
> >>      for (int i = 0; i <= (int)idata.to_delete.size(); ++i) {
> >> -      ops.push_back(make_pair(pair<int, string>(0, ""), &owos[i]));
> >> +      ops.push_back(make_pair(pair<int, string>(0, ""), owos[i]));
> > 
> > this doesn't do anything useful... owos[i] may as well be NULL.  Why not 
> > make it
> > 
> > vector<librados::ObjectWriteOperation> owos(...)
> > 
> > ?
> 
> Because this would lead to a linker error:
> 
> kv_flat_btree_async.o: In function `void
> std::__uninitialized_fill_n<false>::__uninit_fill_n<librados::ObjectWriteOperation*,
> unsigned long,
> librados::ObjectWriteOperation>(librados::ObjectWriteOperation*,
> unsigned long, librados::ObjectWriteOperation const&)':
> /usr/bin/../lib64/gcc/x86_64-suse-linux/4.7/../../../../include/c++/4.7/bits/stl_uninitialized.h:188:
> undefined reference to
> `librados::ObjectOperation::ObjectOperation(librados::ObjectOperation
> const&)'
> /usr/bin/../lib64/gcc/x86_64-suse-linux/4.7/../../../../include/c++/4.7/bits/stl_uninitialized.h:188:
> undefined reference to
> `librados::ObjectOperation::ObjectOperation(librados::ObjectOperation
> const&)'
> 
> 
> Because in src/include/rados/librados.hpp
> librados::ObjectOperation::ObjectOperation(librados::ObjectOperation
> const&) was is defined, but not implemented in the librados.cc.
> 
> Not sure if removing ObjectOperation(librados::ObjectOperation const&)
> is the way to go here.

Oh, I see... yeah, we shouldn't remove that.  Probably we should 
restructure the code to use a list<>, which doesn't require a copy 
constructor or assignment operator.

Note that this particular code shouldn't hold up the rest of the patches, 
since it's not being used by anything (yet!).

sage

  reply	other threads:[~2013-02-11 13:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 19:41 [PATCH 00/15] fix more issues from clang(++) and cppchecker Danny Al-Gaaf
2013-02-07 19:41 ` [PATCH 01/15] kv_flat_btree_async.cc: use vector instead of VLA's Danny Al-Gaaf
2013-02-10  5:57   ` Sage Weil
2013-02-11 13:21     ` Danny Al-Gaaf
2013-02-11 13:57       ` Sage Weil [this message]
2013-02-07 19:41 ` [PATCH 02/15] common/config.h: declaration of config_option as struct Danny Al-Gaaf
2013-02-07 19:41 ` [PATCH 03/15] src/msg/msg_types.h: pass function parameter by reference Danny Al-Gaaf
2013-02-07 19:41 ` [PATCH 04/15] fuse_ll.cc: fix -Wgnu-designator Danny Al-Gaaf
2013-02-07 19:41 ` [PATCH 05/15] common/AsyncReserver.h: use empty() instead of size() Danny Al-Gaaf
2013-02-07 19:41 ` [PATCH 06/15] common/WorkQueue.h: " Danny Al-Gaaf
2013-02-07 19:41 ` [PATCH 07/15] common/config.cc: fix -Wgnu-designator Danny Al-Gaaf
2013-02-07 19:41 ` [PATCH 08/15] src/log/Entry.h: pass function parameter by reference Danny Al-Gaaf
2013-02-07 19:41 ` [PATCH 09/15] src/mon/PGMonitor.cc: remove unused variable Danny Al-Gaaf
2013-02-07 19:41 ` [PATCH 10/15] src/msg/Messenger.h: pass function parameter by reference Danny Al-Gaaf
2013-02-07 19:41 ` [PATCH 11/15] src/osd/OSD.h: use empty() instead of size() Danny Al-Gaaf
2013-02-07 19:42 ` [PATCH 12/15] src/osd/PG.h: " Danny Al-Gaaf
2013-02-07 19:42 ` [PATCH 13/15] src/osd/osd_types.h: pass function parameter by reference Danny Al-Gaaf
2013-02-10  6:00   ` Sage Weil
2013-02-07 19:42 ` [PATCH 14/15] test_mon_workloadgen.cc: fix -Wgnu Danny Al-Gaaf
2013-02-07 19:42 ` [PATCH 15/15] librados/librados.cc: fix implicitly-defined namespace 'std' Danny Al-Gaaf
2013-02-10  6:02 ` [PATCH 00/15] fix more issues from clang(++) and cppchecker Sage Weil
2013-02-10 13:38   ` Danny Al-Gaaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1302110554040.5429@cobra.newdream.net \
    --to=sage@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=danny.al-gaaf@bisect.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.