chitralverma opened a new issue, #9373:
URL: https://github.com/apache/opendal/issues/9373

   *Drafted with AI assistance (Claude Code, Claude Opus 5.5); the author is 
accountable for it.*
   
   ### Feature Description
   
   State the option-string contract in the public docs of the C `*_with` 
functions that take options structs.
   
   ### Problem and Solution
   
   Callers can assign struct members such as `opendal_list_options.start_after` 
directly, without the setters. The internal `// SAFETY:` comments rely on the 
caller passing a non-null string member that is a readable, nul-terminated, 
valid UTF-8 C string 
([operator.rs#L1277](https://github.com/apache/opendal/blob/33f8c4c8b/bindings/c/src/operator.rs#L1277)).
 The public docs do not say so: for example, 
`opendal_operator_list_with_cancel` has no `# Safety` section 
([operator.rs#L1254-L1260](https://github.com/apache/opendal/blob/33f8c4c8b/bindings/c/src/operator.rs#L1254-L1260)).
 #9368 adds the same pattern for `opendal_delete_options.version` in the 
operator, presign, and deleter delete functions.
   
   A string that is not nul-terminated is undefined behavior. A string that is 
not valid UTF-8 panics inside an `extern "C"` function.
   
   Proposed fix: add that contract to the public docs of every `*_with` / 
`*_with_cancel` function that takes a generated options struct. The setters 
already satisfy it.
   
   ### Additional Context
   
   Found during an internal review of #9368. Tracker: #9320, C/Go options: 
#9323.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to