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

Fix uninitialized compiler warnings for: xslope yslope zslope #1371

Merged
merged 2 commits into from
Sep 16, 2020
Merged

Fix uninitialized compiler warnings for: xslope yslope zslope #1371

merged 2 commits into from
Sep 16, 2020

Conversation

mwm126
Copy link
Contributor

@mwm126 mwm126 commented Sep 16, 2020

Summary

Getting compiler warnings when building MFiX-Exa file that includes AMReX_EB_slopes_K.H

Additional background

Building with GCC 7.5.0:

../src/convection/mfix_slopes.cpp: In member function 'void mfix::mfix_compute_slopes(int, amrex::Real, amrex::MultiFab&, const amrex::Vector<amrex::MultiFab*>&, const amrex::Vector<amrex::MultiFab*>&, const amrex::Vector<amrex::MultiFab*>&, int, std::map<std::__cxx11::basic_string<char>, amrex::PODVector<int, std::allocator<int> > >&)':
../src/convection/mfix_slopes.cpp:235:52: error: 'zslope' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                        zs_fab(i,j,k,slopes_comp+n) = eb_slopes[2];
../src/convection/mfix_slopes.cpp:216:52: error: 'yslope' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                        ys_fab(i,j,k,slopes_comp+n) = eb_slopes[1];
../src/convection/mfix_slopes.cpp:197:52: error: 'xslope' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                        xs_fab(i,j,k,slopes_comp+n) = eb_slopes[0];

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • are described in the proposed changes to the AMReX documentation, if appropriate

@WeiqunZhang WeiqunZhang merged commit ea27c40 into AMReX-Codes:development Sep 16, 2020
kweide pushed a commit to ECP-Astro/amrex that referenced this pull request Sep 28, 2020
…Codes#1371)

## Summary

Getting compiler warnings when building MFiX-Exa file that includes `AMReX_EB_slopes_K.H`

## Additional background

Building with GCC 7.5.0:
```
../src/convection/mfix_slopes.cpp: In member function 'void mfix::mfix_compute_slopes(int, amrex::Real, amrex::MultiFab&, const amrex::Vector<amrex::MultiFab*>&, const amrex::Vector<amrex::MultiFab*>&, const amrex::Vector<amrex::MultiFab*>&, int, std::map<std::__cxx11::basic_string<char>, amrex::PODVector<int, std::allocator<int> > >&)':
../src/convection/mfix_slopes.cpp:235:52: error: 'zslope' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                        zs_fab(i,j,k,slopes_comp+n) = eb_slopes[2];
../src/convection/mfix_slopes.cpp:216:52: error: 'yslope' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                        ys_fab(i,j,k,slopes_comp+n) = eb_slopes[1];
../src/convection/mfix_slopes.cpp:197:52: error: 'xslope' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                        xs_fab(i,j,k,slopes_comp+n) = eb_slopes[0];
```

## Checklist

The proposed changes:
- [X] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX users
- [ ] are described in the proposed changes to the AMReX documentation, if appropriate


Co-authored-by: Mark Meredith <mark.meredith@netl.doe.gov>
kweide added a commit to ECP-Astro/amrex that referenced this pull request Sep 28, 2020
dwillcox pushed a commit to dwillcox/amrex that referenced this pull request Oct 3, 2020
…Codes#1371)

## Summary

Getting compiler warnings when building MFiX-Exa file that includes `AMReX_EB_slopes_K.H`

## Additional background

Building with GCC 7.5.0:
```
../src/convection/mfix_slopes.cpp: In member function 'void mfix::mfix_compute_slopes(int, amrex::Real, amrex::MultiFab&, const amrex::Vector<amrex::MultiFab*>&, const amrex::Vector<amrex::MultiFab*>&, const amrex::Vector<amrex::MultiFab*>&, int, std::map<std::__cxx11::basic_string<char>, amrex::PODVector<int, std::allocator<int> > >&)':
../src/convection/mfix_slopes.cpp:235:52: error: 'zslope' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                        zs_fab(i,j,k,slopes_comp+n) = eb_slopes[2];
../src/convection/mfix_slopes.cpp:216:52: error: 'yslope' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                        ys_fab(i,j,k,slopes_comp+n) = eb_slopes[1];
../src/convection/mfix_slopes.cpp:197:52: error: 'xslope' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                        xs_fab(i,j,k,slopes_comp+n) = eb_slopes[0];
```

## Checklist

The proposed changes:
- [X] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX users
- [ ] are described in the proposed changes to the AMReX documentation, if appropriate


Co-authored-by: Mark Meredith <mark.meredith@netl.doe.gov>
@mwm126 mwm126 deleted the fix_warnings branch December 26, 2020 17:36
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