Skip to content

api: add OIIO_NODISCARD_ERROR to Imageio.h#5218

Merged
lgritz merged 2 commits into
AcademySoftwareFoundation:mainfrom
zoomhunter2010:OIIO_NODISCARD_ERROR-addition
May 31, 2026
Merged

api: add OIIO_NODISCARD_ERROR to Imageio.h#5218
lgritz merged 2 commits into
AcademySoftwareFoundation:mainfrom
zoomhunter2010:OIIO_NODISCARD_ERROR-addition

Conversation

@zoomhunter2010
Copy link
Copy Markdown
Contributor

Description

Add OIIO_NODISCARD_ERROR to make sure callers check their bool return values

Assisted by: Claude Sonnet 4.6
Reference: #4781

Tests

No new test suite case added

Checklist:

  • I have read the guidelines on contributions and code review procedures.
  • I have read the Policy on AI Coding Assistants
    and if I used AI coding assistants, I have an Assisted-by: TOOL / MODEL
    line in the pull request description above.
  • I have updated the documentation if my PR adds features or changes
    behavior.
  • I am sure that this PR's changes are tested in the testsuite.
  • I have run and passed the testsuite in CI before submitting the
    PR, by pushing the changes to my fork and seeing that the automated CI
    passed there. (Exceptions: If most tests pass and you can't figure out why
    the remaining ones fail, it's ok to submit the PR and ask for help. Or if
    any failures seem entirely unrelated to your change; sometimes things break
    on the GitHub runners.)
  • My code follows the prevailing code style of this project and I
    fixed any problems reported by the clang-format CI test.
  • If I added or modified a public C++ API call, I have also amended the
    corresponding Python bindings. If altering ImageBufAlgo functions, I also
    exposed the new functionality as oiiotool options.

Signed-off-by: Hunter <zoomhunter2010@gmail.com>
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 30, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: zoomhunter2010 / name: Hunter (11314ce)

@zoomhunter2010 zoomhunter2010 marked this pull request as draft May 30, 2026 06:20
@zoomhunter2010 zoomhunter2010 marked this pull request as ready for review May 30, 2026 06:21
@zoomhunter2010 zoomhunter2010 changed the title Update imageio.h api: add OIIO_NODISCARD_ERROR to ImageIO.h May 30, 2026
@zoomhunter2010 zoomhunter2010 changed the title api: add OIIO_NODISCARD_ERROR to ImageIO.h api: add OIIO_NODISCARD_ERROR to Imageio.h May 30, 2026
Copy link
Copy Markdown
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the changes you made used OIIO_NODISCARD_ERROR, but none of the functions annotated return error codes. Those are all cases where they really do return a value, and so so should use OIIO_NODISCARD.

Also, while it's ok to just change a few functions, I'm wonder how and why you chose just these three in particular, instead of, say, choosing one class and annotating all the appropriate member functions in that class?

Comment thread src/include/OpenImageIO/imageio.h Outdated
Fix my OIIO_NODISCARD_ERROR additions acording to comments on my pr

Signed-off-by: Hunter <zoomhunter2010@gmail.com>
@lgritz lgritz added the core APIs Affecting public APIs of core functionality classes, such as ImageInput, ImageOutput, ImageBuf. label May 31, 2026
Copy link
Copy Markdown
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the patch.

@lgritz lgritz merged commit b59db08 into AcademySoftwareFoundation:main May 31, 2026
28 checks passed
@lgritz
Copy link
Copy Markdown
Collaborator

lgritz commented May 31, 2026

Can I ask a question without it seeming accusatory? I'm always trying to learn more about how people are using coding assistants in practice.

Your PR said "Assisted by: Claude Sonnet 4.6", and considering that your patch changed only 3 lines (and, um, not entirely correctly the first time), I'm really curious in what way you used the tool. What did you ask it to do, and do you feel like it saved you any time for this task?

@zoomhunter2010
Copy link
Copy Markdown
Contributor Author

For me, I try not to let it do much of the work for me. I try to use it to explain things to me or help me skim through the larger files. I do believe it's a bad habit because it isn't always right, and it can just make stuff up. I think for this task, it didn't end up saving me time.

@lgritz
Copy link
Copy Markdown
Collaborator

lgritz commented May 31, 2026

I think that's 100% the right attitude.

Our request to document LLM use with "assisted-by" is for if you are having it directly help you write the code you submit. If you're just using it to explain existing code to you, find things in a big codebase, answer general questions about programming, or even review the code you're written before you submit a PR, I don't think you need to bother with the "assisted-by."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core APIs Affecting public APIs of core functionality classes, such as ImageInput, ImageOutput, ImageBuf.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants