|
Hi Xiao-Yong, with reinterpret_cast<size_t> I am getting (gcc 4.8) this: Thread_context.cc: In member function ‘void Thread_context::print(std::ostream&) const’: Thread_context.cc:73:42: error: invalid cast from type ‘pthread_t {aka long unsigned int}’ to type ‘size_t {aka unsigned int}’ << reinterpret_cast<size_t>(thread) ^ make[1]: *** [apl-Thread_context.o] Error 1 It seems a little ridiculous to me that replacing a good old C-style cast that worked fine for the last 10 years cannot be replaced by one of the 3 members of the C++ zoo of casts in a portable way? Maybe some intermediate cast to const void * can be done on your machine? Best Regards, Jürgen On 09/19/2017 11:44 PM, Xiao-Yong Jin
wrote:
Should have got back to you sooner, but static_cast is not allowed between pointer types and non-pointer types. |
- [Bug-apl] cast from pointer to smaller type 'int' Xiao-Yong Jin
- Re: [Bug-apl] cast from pointer to smaller type 'in... Juergen Sauermann
- Re: [Bug-apl] cast from pointer to smaller type... Xiao-Yong Jin
- Re: [Bug-apl] cast from pointer to smaller ... Juergen Sauermann
- Re: [Bug-apl] cast from pointer to smal... Xiao-Yong Jin
- Re: [Bug-apl] cast from pointer to... Juergen Sauermann
- Re: [Bug-apl] cast from pointe... Juergen Sauermann
- Re: [Bug-apl] cast from po... Xiao-Yong Jin
- Re: [Bug-apl] cast from po... Xiao-Yong Jin
- Re: [Bug-apl] cast from po... Juergen Sauermann
- Re: [Bug-apl] cast from pointe... Xiao-Yong Jin
- Re: [Bug-apl] cast from po... Juergen Sauermann
