-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fix all maybe-uninitialized warnings #492
Conversation
@@ -664,8 +664,7 @@ putElement(char *file, uint16 tag, uint16 ref, char *data, int32 len) | |||
int | |||
writeGrp(char *file) | |||
{ | |||
int i; | |||
uint16 ref; | |||
uint16 ref = DFREF_NONE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not initialized (DFREF_NONE is the best "bad" value)
@@ -892,39 +892,41 @@ do_list(intn curr_arg, intn argc, char *argv[], intn help) | |||
int32 an_id = FAIL; /* annotation interface handle */ | |||
intn ret_value = SUCCEED; | |||
|
|||
/* Do this early, to avoid uninitialized warnings in cleanup code */ | |||
init_list_opts(&list_opts); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was initialized after some goto done
calls, so the compiler complains about the string in list_opts not always being initialized.
@@ -2501,7 +2501,7 @@ pixrep(struct Input *in, struct Raster *im) | |||
static int32 | |||
create_SDS(int32 sd_id, int32 nt, struct Input *in) | |||
{ | |||
int32 sds_id; | |||
int32 sds_id = FAIL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uninitialized. FAIL is the "bad" value.
@@ -2712,7 +2712,8 @@ process(struct Options *opt) | |||
int32 len; | |||
FILE *strm = NULL; | |||
int32 hdf; | |||
int32 sd_id, sds_id; | |||
int32 sd_id = FAIL; | |||
int32 sds_id = FAIL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uninitialized. FAIL is the "bad" value.
@@ -88,7 +88,8 @@ test_dim1_SDS1(void) | |||
float32 sds1_data[] = {0.1, 2.3, 4.5, 6.7, 8.9}; | |||
float32 out_data[5]; | |||
int32 dimsize[1]; | |||
int32 sds_id, file_id, dim_id, index; | |||
int32 sds_id, file_id, dim_id; | |||
int32 index = FAIL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uninitialized. FAIL is the "bad" value.
No description provided.