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

i.atcorr: Fix uninitialized variable #4022

Merged
merged 11 commits into from
Jul 13, 2024
Merged

Conversation

ShubhamDesai
Copy link
Contributor

This pull request addresses uninitialized variable issue for all cpp files in imagery

Issue:
i.atcorr/main.cpp:213:16: error: Uninitialized variable: rbitem.ti [uninitvar]
return rbitem;

Changes Made:
Initialized the RBitem struct to zero to ensure all members, including nested structures, are properly initialized.

@echoix
Copy link
Member

echoix commented Jul 10, 2024

There was only one file left?

@ShubhamDesai
Copy link
Contributor Author

There was only one file left?

yes in imagery folder there is only one cpp file left other files are c file. So now i am grouping folder wise and programming language wise

@github-actions github-actions bot added C++ Related code is in C++ module imagery labels Jul 10, 2024
@ShubhamDesai ShubhamDesai changed the title imagery: Fix uninitialize variable for all cpp files in imagery Jul 10, 2024
@echoix
Copy link
Member

echoix commented Jul 10, 2024

There was only one file left?

yes in imagery folder there is only one cpp file left other files are c file. So now i am grouping folder wise and programming language wise

Perfect!

@echoix echoix changed the title i.atcorr: Fix uninitialize variable for all cpp files in imagery Jul 10, 2024
@echoix
Copy link
Member

echoix commented Jul 11, 2024

See the new error here (and build failure) (ignore the garbage of the html file, it seems like unsynced output of parallel tasks):

<r.relief.html> is missing the descriptionmain.cpp: In member function ‘RBitem TICache::set_alt_vis(double, double)’:
main.cpp:207:34: error: missing initializer for member ‘RBitem::vis’ [-Werror=missing-field-initializers]
  207 |         struct RBitem rbitem = {0};
      |                                  ^
main.cpp:207:34: error: missing initializer for member ‘RBitem::ti’ [-Werror=missing-field-initializers]
cc1plus: all warnings being treated as errors
make[3]: *** [../../include/Make/Compile.make:35: OBJ.x86_64-pc-linux-gnu/main.o] Error 1

https://github.com/OSGeo/grass/actions/runs/9880555579/job/27289369496?pr=4022#step:8:8216

@ShubhamDesai
Copy link
Contributor Author

ShubhamDesai commented Jul 11, 2024

See the new error here (and build failure) (ignore the garbage of the html file, it seems like unsynced output of parallel tasks):

<r.relief.html> is missing the descriptionmain.cpp: In member function ‘RBitem TICache::set_alt_vis(double, double)’:
main.cpp:207:34: error: missing initializer for member ‘RBitem::vis’ [-Werror=missing-field-initializers]
  207 |         struct RBitem rbitem = {0};
      |                                  ^
main.cpp:207:34: error: missing initializer for member ‘RBitem::ti’ [-Werror=missing-field-initializers]
cc1plus: all warnings being treated as errors
make[3]: *** [../../include/Make/Compile.make:35: OBJ.x86_64-pc-linux-gnu/main.o] Error 1

https://github.com/OSGeo/grass/actions/runs/9880555579/job/27289369496?pr=4022#step:8:8216

let me check

i did the changes i think because it has two nested struct members it was not initializing everything.

Shubham Vasudeo Desai and others added 2 commits July 10, 2024 20:24
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
echoix
echoix previously approved these changes Jul 11, 2024
Shubham Vasudeo Desai and others added 3 commits July 12, 2024 12:59
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
imagery/i.atcorr/main.cpp Outdated Show resolved Hide resolved
imagery/i.atcorr/main.cpp Outdated Show resolved Hide resolved
ShubhamDesai and others added 2 commits July 12, 2024 17:57
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@nilason nilason enabled auto-merge (squash) July 13, 2024 06:30
Copy link
Contributor

@nilason nilason left a comment

Choose a reason for hiding this comment

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

Thanks!

@nilason nilason merged commit 8f83c24 into OSGeo:main Jul 13, 2024
26 checks passed
@neteler neteler added this to the 8.5.0 milestone Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ Related code is in C++ imagery module
5 participants