All of lore.kernel.org
 help / color / mirror / Atom feed
* need help about _ASSERT_H in dout
@ 2017-02-06 11:00 liuchang0812
  2017-02-06 11:15 ` kefu chai
  0 siblings, 1 reply; 4+ messages in thread
From: liuchang0812 @ 2017-02-06 11:00 UTC (permalink / raw)
  To: Sage Weil, ceph-devel

hi, Sage and Cephers

I tried to use boost::algorithm in os/bluefs.cc this afternoon. I got
such error when i included "boost/algorithm/string.hpp".

/home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc: In member
function ‘int BlueFS::add_block_device(unsigned int,
std::__cxx11::string)’:
/home/liuchang/WorkSpace/ceph/src/common/dout.h:81:12: error: base
operand of ‘->’ is not a pointer
   _ASSERT_H->_log->submit_entry(_dout_e);  \


I have found this commit[1] that includes _ASSERT_H. i can't
understand why replace _dout_cct with _ASSERT_H and what
boost::algorithm confilicts with _ASSERT_H。

thanks, any comments are appreciated.


[1]: https://github.com/ceph/ceph/commit/a30601a1b69c3f1ac5cfa592050877aec8b5be9d

[2]: more log as :

/home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc: In member
function ‘int BlueFS::add_block_device(unsigned int,
std::__cxx11::string)’:
/home/liuchang/WorkSpace/ceph/src/common/dout.h:81:12: error: base
operand of ‘->’ is not a pointer
   _ASSERT_H->_log->submit_entry(_dout_e);  \
            ^
/home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc:119:65: note:
in expansion of macro ‘dendl’
   dout(10) << __func__ << " bdev " << id << " path " << path << dendl;
                                                                 ^
/home/liuchang/WorkSpace/ceph/src/common/dout.h:62:18: warning: unused
variable ‘_dout_cct’ [-Wunused-variable]
     CephContext *_dout_cct = cct;     \
                  ^
/home/liuchang/WorkSpace/ceph/src/common/dout.h:66:24: note: in
expansion of macro ‘dout_impl’
 #define ldout(cct, v)  dout_impl(cct, dout_subsys, v) dout_prefix
                        ^
/home/liuchang/WorkSpace/ceph/src/common/debug.h:23:17: note: in
expansion of macro ‘ldout’
 #define dout(v) ldout((dout_context), v)
                 ^
/home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc:119:3: note:
in expansion of macro ‘dout’
   dout(10) << __func__ << " bdev " << id << " path " << path << dendl;

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

* Re: need help about _ASSERT_H in dout
  2017-02-06 11:00 need help about _ASSERT_H in dout liuchang0812
@ 2017-02-06 11:15 ` kefu chai
  2017-02-06 11:19   ` liuchang0812
  2017-02-06 14:27   ` Sage Weil
  0 siblings, 2 replies; 4+ messages in thread
From: kefu chai @ 2017-02-06 11:15 UTC (permalink / raw)
  To: liuchang0812; +Cc: Sage Weil, ceph-devel

On Mon, Feb 6, 2017 at 7:00 PM, liuchang0812 <liuchang0812@gmail.com> wrote:
> hi, Sage and Cephers
>
> I tried to use boost::algorithm in os/bluefs.cc this afternoon. I got
> such error when i included "boost/algorithm/string.hpp".
>
> /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc: In member
> function ‘int BlueFS::add_block_device(unsigned int,
> std::__cxx11::string)’:
> /home/liuchang/WorkSpace/ceph/src/common/dout.h:81:12: error: base
> operand of ‘->’ is not a pointer
>    _ASSERT_H->_log->submit_entry(_dout_e);  \
>
>
> I have found this commit[1] that includes _ASSERT_H. i can't
> understand why replace _dout_cct with _ASSERT_H and what
> boost::algorithm confilicts with _ASSERT_H。

because boost/algorithm/string.hpp includes "assert.h" from libc. you
need to re-included "include/assert.h" to override the `assert()` from
libc.

>
> thanks, any comments are appreciated.
>
>
> [1]: https://github.com/ceph/ceph/commit/a30601a1b69c3f1ac5cfa592050877aec8b5be9d
>
> [2]: more log as :
>
> /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc: In member
> function ‘int BlueFS::add_block_device(unsigned int,
> std::__cxx11::string)’:
> /home/liuchang/WorkSpace/ceph/src/common/dout.h:81:12: error: base
> operand of ‘->’ is not a pointer
>    _ASSERT_H->_log->submit_entry(_dout_e);  \
>             ^
> /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc:119:65: note:
> in expansion of macro ‘dendl’
>    dout(10) << __func__ << " bdev " << id << " path " << path << dendl;
>                                                                  ^
> /home/liuchang/WorkSpace/ceph/src/common/dout.h:62:18: warning: unused
> variable ‘_dout_cct’ [-Wunused-variable]
>      CephContext *_dout_cct = cct;     \
>                   ^
> /home/liuchang/WorkSpace/ceph/src/common/dout.h:66:24: note: in
> expansion of macro ‘dout_impl’
>  #define ldout(cct, v)  dout_impl(cct, dout_subsys, v) dout_prefix
>                         ^
> /home/liuchang/WorkSpace/ceph/src/common/debug.h:23:17: note: in
> expansion of macro ‘ldout’
>  #define dout(v) ldout((dout_context), v)
>                  ^
> /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc:119:3: note:
> in expansion of macro ‘dout’
>    dout(10) << __func__ << " bdev " << id << " path " << path << dendl;
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Regards
Kefu Chai

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

* Re: need help about _ASSERT_H in dout
  2017-02-06 11:15 ` kefu chai
@ 2017-02-06 11:19   ` liuchang0812
  2017-02-06 14:27   ` Sage Weil
  1 sibling, 0 replies; 4+ messages in thread
From: liuchang0812 @ 2017-02-06 11:19 UTC (permalink / raw)
  To: kefu chai; +Cc: Sage Weil, ceph-devel

ok, thanks! @kefu chai

2017-02-06 19:15 GMT+08:00 kefu chai <tchaikov@gmail.com>:
> On Mon, Feb 6, 2017 at 7:00 PM, liuchang0812 <liuchang0812@gmail.com> wrote:
>> hi, Sage and Cephers
>>
>> I tried to use boost::algorithm in os/bluefs.cc this afternoon. I got
>> such error when i included "boost/algorithm/string.hpp".
>>
>> /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc: In member
>> function ‘int BlueFS::add_block_device(unsigned int,
>> std::__cxx11::string)’:
>> /home/liuchang/WorkSpace/ceph/src/common/dout.h:81:12: error: base
>> operand of ‘->’ is not a pointer
>>    _ASSERT_H->_log->submit_entry(_dout_e);  \
>>
>>
>> I have found this commit[1] that includes _ASSERT_H. i can't
>> understand why replace _dout_cct with _ASSERT_H and what
>> boost::algorithm confilicts with _ASSERT_H。
>
> because boost/algorithm/string.hpp includes "assert.h" from libc. you
> need to re-included "include/assert.h" to override the `assert()` from
> libc.
>
>>
>> thanks, any comments are appreciated.
>>
>>
>> [1]: https://github.com/ceph/ceph/commit/a30601a1b69c3f1ac5cfa592050877aec8b5be9d
>>
>> [2]: more log as :
>>
>> /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc: In member
>> function ‘int BlueFS::add_block_device(unsigned int,
>> std::__cxx11::string)’:
>> /home/liuchang/WorkSpace/ceph/src/common/dout.h:81:12: error: base
>> operand of ‘->’ is not a pointer
>>    _ASSERT_H->_log->submit_entry(_dout_e);  \
>>             ^
>> /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc:119:65: note:
>> in expansion of macro ‘dendl’
>>    dout(10) << __func__ << " bdev " << id << " path " << path << dendl;
>>                                                                  ^
>> /home/liuchang/WorkSpace/ceph/src/common/dout.h:62:18: warning: unused
>> variable ‘_dout_cct’ [-Wunused-variable]
>>      CephContext *_dout_cct = cct;     \
>>                   ^
>> /home/liuchang/WorkSpace/ceph/src/common/dout.h:66:24: note: in
>> expansion of macro ‘dout_impl’
>>  #define ldout(cct, v)  dout_impl(cct, dout_subsys, v) dout_prefix
>>                         ^
>> /home/liuchang/WorkSpace/ceph/src/common/debug.h:23:17: note: in
>> expansion of macro ‘ldout’
>>  #define dout(v) ldout((dout_context), v)
>>                  ^
>> /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc:119:3: note:
>> in expansion of macro ‘dout’
>>    dout(10) << __func__ << " bdev " << id << " path " << path << dendl;
>> --
>> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
> --
> Regards
> Kefu Chai

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

* Re: need help about _ASSERT_H in dout
  2017-02-06 11:15 ` kefu chai
  2017-02-06 11:19   ` liuchang0812
@ 2017-02-06 14:27   ` Sage Weil
  1 sibling, 0 replies; 4+ messages in thread
From: Sage Weil @ 2017-02-06 14:27 UTC (permalink / raw)
  To: kefu chai; +Cc: liuchang0812, ceph-devel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 3087 bytes --]

On Mon, 6 Feb 2017, kefu chai wrote:
> On Mon, Feb 6, 2017 at 7:00 PM, liuchang0812 <liuchang0812@gmail.com> wrote:
> > hi, Sage and Cephers
> >
> > I tried to use boost::algorithm in os/bluefs.cc this afternoon. I got
> > such error when i included "boost/algorithm/string.hpp".
> >
> > /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc: In member
> > function ‘int BlueFS::add_block_device(unsigned int,
> > std::__cxx11::string)’:
> > /home/liuchang/WorkSpace/ceph/src/common/dout.h:81:12: error: base
> > operand of ‘->’ is not a pointer
> >    _ASSERT_H->_log->submit_entry(_dout_e);  \
> >
> >
> > I have found this commit[1] that includes _ASSERT_H. i can't
> > understand why replace _dout_cct with _ASSERT_H and what
> > boost::algorithm confilicts with _ASSERT_H。
> 
> because boost/algorithm/string.hpp includes "assert.h" from libc. you
> need to re-included "include/assert.h" to override the `assert()` from
> libc.

or better yet, include the boost headers early, before any ceph headers 
get included, such that ceph's assert.h is still only included once.

sage

> 
> >
> > thanks, any comments are appreciated.
> >
> >
> > [1]: https://github.com/ceph/ceph/commit/a30601a1b69c3f1ac5cfa592050877aec8b5be9d
> >
> > [2]: more log as :
> >
> > /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc: In member
> > function ‘int BlueFS::add_block_device(unsigned int,
> > std::__cxx11::string)’:
> > /home/liuchang/WorkSpace/ceph/src/common/dout.h:81:12: error: base
> > operand of ‘->’ is not a pointer
> >    _ASSERT_H->_log->submit_entry(_dout_e);  \
> >             ^
> > /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc:119:65: note:
> > in expansion of macro ‘dendl’
> >    dout(10) << __func__ << " bdev " << id << " path " << path << dendl;
> >                                                                  ^
> > /home/liuchang/WorkSpace/ceph/src/common/dout.h:62:18: warning: unused
> > variable ‘_dout_cct’ [-Wunused-variable]
> >      CephContext *_dout_cct = cct;     \
> >                   ^
> > /home/liuchang/WorkSpace/ceph/src/common/dout.h:66:24: note: in
> > expansion of macro ‘dout_impl’
> >  #define ldout(cct, v)  dout_impl(cct, dout_subsys, v) dout_prefix
> >                         ^
> > /home/liuchang/WorkSpace/ceph/src/common/debug.h:23:17: note: in
> > expansion of macro ‘ldout’
> >  #define dout(v) ldout((dout_context), v)
> >                  ^
> > /home/liuchang/WorkSpace/ceph/src/os/bluestore/BlueFS.cc:119:3: note:
> > in expansion of macro ‘dout’
> >    dout(10) << __func__ << " bdev " << id << " path " << path << dendl;
> > --
> > To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 
> -- 
> Regards
> Kefu Chai
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

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

end of thread, other threads:[~2017-02-06 14:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-06 11:00 need help about _ASSERT_H in dout liuchang0812
2017-02-06 11:15 ` kefu chai
2017-02-06 11:19   ` liuchang0812
2017-02-06 14:27   ` Sage Weil

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.