[op25-dev] need help using extract()

Matt D md123 at nycap.rr.com
Wed Dec 11 14:56:49 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> the vector is defined private in the .h file.   Any help will be
> much appreciated.
> 
> 

something has got to be wrong with the vector, or how I am trying to get
it into the other functions, although I do not know what.  Trying to
print the vector in another makes the program die exactly at the time
of trying to access the vector:

Program terminated with signal 11, Segmentation fault.
#0  operator bool (this=<optimized out>)
    at /usr/include/c++/4.7/bits/stl_bvector.h:82
82	    { return !!(*_M_p & _M_mask); }
(gdb) bt
#0  operator bool (this=<optimized out>)
    at /usr/include/c++/4.7/bits/stl_bvector.h:82
#1  operator* (this=<optimized out>)
    at /usr/include/c++/4.7/bits/stl_bvector.h:288
#2  operator[] (__n=0, this=<optimized out>)
    at /usr/include/c++/4.7/bits/stl_bvector.h:712
#3  ldu1::lcf (this=0xaf702010) at ldu1.cc:137  //print statement location
#4  0xb2d4ea01 in ldu1::snapshot (this=0xaf702010) at ldu1.cc:102
#5  0xb2d539ab in snapshot_du_handler::handle (this=0xa8ffcf0, du=...)
    at snapshot_du_handler.cc:44
#6  0xaf703aa4 in ?? ()

here is the function where the print is located:
uint16_t
ldu1::lcf() const
{
    int i;
    uint16_t lcf;
    printf("\n      LCF:  ");
    for(i=0; i<8; i++) cout << decoded_lcw_vec[i];
    for(i=0; i<8; i++) lcf = decoded_lcw_vec[i];
    return lcf;

}

Some say vector<bool> is buggy and cannot be trusted but I see it works
well in the rest of the program.  How can I safely get the vector from
one function to another without putting it in as a function parameter?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.21 (GNU/Linux)
Comment: MacGPG2 - http://www.gpgtools.org/macgpg2.html
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSqH0xAAoJECrdp7MWSIVb0MkH/3HMLaumhq5D1FbIDKqE8SiC
KcH6t/Lg43w2T43H9/zkYqAcTyglsD67Lct5YCQjxn4Rj1MIk7/muwkH0w8X1dna
NV3lYlrNg3FlX+Pc3dz1bNS6xHwc9jeQftLmLI7rMb4O8/aKLMp2zVw2jHa+aKsY
g8fF6Q1gT0bEWqelh0XtmKhzI4v+7iHCsKtRBV609NSM8K8MxCE41cMbHERgAkLX
7TF6ojN+s3iKIMb2n6eY4xvTHz77TN4bZJtFLn5jWpn+UnXaBdfwUVC7VnrePJr0
/n1IrmrnqRAnp/lOMZ+ooWN0DV7MjapJSVanYpoBWyys09fgANBdedJQOjSgbyo=
=DN1b
-----END PGP SIGNATURE-----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/op25-dev/attachments/20131211/750a7666/attachment.html>


More information about the op25-dev mailing list