You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the analyzer on amalgamated CFS adds lifetimes to pointer arguments of publicly exported C functions part of the public API (not called from inside CFS), e.g.
IIRC this is basically intended/expected behavior at the moment. We've mainly been targeting application code, where callers can be updated in lockstep when function signatures change. It's generally hard to tell which things are actually "publicly exported" as part of the library API as opposed to just being non-static so they can be called from another compilation unit within the same library. (Knowing that a particular function is/isn't called elsewhere within the library doesn't necessarily help with getting a precise answer here.)
One thing we've talked about doing in the past is splitting API functions into an internal version whose signature we can change and an external shim that keeps the original signature and converts the arguments/return value to match the new signature. In this case, it might look like this:
#[no_mangle]pubunsafeextern"C"fnOS_GetLocalTime(muttime_struct:*mutOS_time_t) -> int32{OS_GetLocalTime_internal(&*time_struct)}unsafefnOS_GetLocalTime_internal<'h0>(muttime_struct:&'h0 (OS_time_t)) -> int32{// Actual logic goes here}
There's some code in rewrite::shim that could potentially be reused to generate the shims. We already do this in some cases where a function that's marked non-rewritable/FIXED calls into one that we do want to rewrite.
Running the analyzer on amalgamated CFS adds lifetimes to pointer arguments of publicly exported C functions part of the public API (not called from inside CFS), e.g.
where the original function signature was
pub unsafe extern "C" fn OS_GetLocalTime(mut time_struct: *mut OS_time_t) -> int32
.The text was updated successfully, but these errors were encountered: