Amar Takhar commented on a discussion on 
cpukit/libdebugger/rtems-debugger-aarch64.c: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/803#note_135137

 >    memcpy( &thread->registers[ offset ], &value, sizeof( uint64_t ) );
 >  }
 >  
 > -static const uint64_t rtems_debugger_get_int_reg(
 > +static uint64_t rtems_debugger_get_int_reg(

That's interesting and makes sense but in this scenario the only way to enforce 
the constness is to have a way to permanently store the value and free it later 
when you don't need it?  It certainly doesn't make sense to say your intent 
with `const` when it can't be enforced however if we're going to add docs for 
this scenario we should at least say what developers should be doing to enforce 
it if you really need to in the case of a temporary return value as in this 
case.

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/803#note_135137
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to