Skip to content

Conversation

@mabruzzo
Copy link
Collaborator

To be reviewed after #468 is merged


Before making any changes, I introduced a bunch of unit tests to test the API. Along the way, I actually identified a very minor edge case where our docs suggest that passing a nullptr as an argument should produce a nullptr while we instead triggered a segmentation fault.

Then I updated the logic. I needed to change the implementation. While what we were doing was valid C, it was almost certainly undefined behavior in C++.1

Footnotes

  1. The code probably would have worked, but why risk it? The compiler implementers are free to do whatever they want when behavior is undefined. Plus, while the code may have worked today, this is the exact sort of thing that could break at an arbitrary time in the future

@mabruzzo mabruzzo added the refactor internal reorganization or code simplification with no behavior changes label Dec 19, 2025
@mabruzzo mabruzzo changed the base branch from main to newchem-cpp December 19, 2025 02:29
@mabruzzo mabruzzo force-pushed the ncc/cppify-dynamic-api branch from 78b9ab5 to 367a494 Compare December 19, 2025 02:32
@mabruzzo mabruzzo force-pushed the ncc/cppify-dynamic-api branch from 7802d44 to f8916fc Compare December 19, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor internal reorganization or code simplification with no behavior changes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant