Skip to content

Commit

Permalink
tests: remove warnings on Centos 7 in iio_writedev/iio_readdev
Browse files Browse the repository at this point in the history
We were getting:
error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     printf("Example : " MY_NAME " -u %s -b 256 -s 1024 %s\n",

because, well - we were using it uninitialized...

Initialize it properly

Signed-off-by: Robin Getz <robin.getz@analog.com>
  • Loading branch information
rgetz authored and pcercuei committed Feb 21, 2022
1 parent 773c1fa commit ad19115
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/iio_readdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ int main(int argc, char **argv)
unsigned int nb_devices = iio_context_get_devices_count(ctx);

for (i = 0; i < nb_devices; i++) {
const char *dev_id, *label, *name;
const char *dev_id = NULL, *label = NULL, *name = NULL;
bool hit;

dev = iio_context_get_device(ctx, i);
Expand Down
2 changes: 1 addition & 1 deletion tests/iio_writedev.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ int main(int argc, char **argv)
unsigned int nb_devices = iio_context_get_devices_count(ctx);

for (i = 0; i < nb_devices; i++) {
const char *dev_id, *label, *name;
const char *dev_id = NULL, *label = NULL, *name = NULL;
bool hit;

dev = iio_context_get_device(ctx, i);
Expand Down

0 comments on commit ad19115

Please sign in to comment.