This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, newlib] Allow locking routine to be retargeted


On Wed, 2016-12-14 at 14:36 +0000, Thomas Preudhomme wrote:
> Why is struct _lock easier to debug by the way?

I think the reason is that in user code - which does the "retargeting"
- _lock can be defined to be whatever is needed, so in the debugger you
see the contents of the struct. If you use void*, then you have to do
manual casting in debugger to see these contents.

I think this will also help to keep the retargeting code valid - now
the compiler can check whether you use correct types - either _lock or
it's address, while with void* the compiler will happily accept almost
anything.

Regards,
FCh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]