Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the encoded error in the iio structures for utils and examples #1220

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dNechita
Copy link
Contributor

@dNechita dNechita commented Dec 9, 2024

PR Description

Replace old way of checking pointers returned by iio_create_context().
The pointers returned by iio_create_context() need to be checked with iio_err().

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have commented new code, particulary complex or unclear areas
  • I have checked that I did not intoduced new warnings or errors (CI output)
  • I have checked that components that use libiio did not get broken
  • I have updated the documentation accordingly (GitHub Pages, READMEs, etc)

@rgetz
Copy link
Contributor

rgetz commented Jan 8, 2025

if (!ctx) shows up in alot of the other utils - you should try to update everything at the same time...

@dNechita dNechita self-assigned this Jan 9, 2025
@dNechita dNechita force-pushed the fix-stresstest-ctx-check branch from 6dc01c2 to 90bebae Compare January 9, 2025 14:08
@dNechita dNechita changed the title utils: Check the encoded error in the context pointer Check the encoded error in the iio structures for utils and examples Jan 9, 2025
@dNechita
Copy link
Contributor Author

dNechita commented Jan 9, 2025

if (!ctx) shows up in alot of the other utils - you should try to update everything at the same time...

This indeed shows up in alot of other utils but some 'ctx' variables do not come directly from the libiio API (e.g. handle_common_opts() ) and are already checked for an error. I did inspect where each 'ctx' variable comes from and updated things where needed.

@dNechita
Copy link
Contributor Author

dNechita commented Jan 9, 2025

V2:

  • updated code from utils/ and /examples in order to check for encoded error in several iio structures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants