Skip to content

Commit

Permalink
GNU and Clang are picky with this particular warning that often shows…
Browse files Browse the repository at this point in the history
… up in downstream applications (MOAB). (#88)

A sample warning message is shown below. This can be replicated when instantiating the operator [] of
DataArray2D and DataArray3D.
```
Subscript.h:33:8: warning: zero size arrays are an extension [-Wzero-length-array]
        T ix_[size];
              ^~~~
Subscript.h:69:30: note: in instantiation of template class 'index_array<long, 0>' requested here
        index_array<size_type, Dim> indices_;
                                    ^
DataArray3D.h:399:35: note: in instantiation of template class 'Subscript<DataArray3D<int>, 3, 3>' requested here
                Subscript<DataArray3D<T>, 3, 3> s(*this);
```
  • Loading branch information
vijaysm authored Oct 20, 2021
1 parent 3d64096 commit 60b99ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Subscript.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
template <typename T, size_t size>
struct index_array
{
T ix_[size];
T ix_[size+1];

#if defined(__INTEL_COMPILER)
inline T& operator[](int i) {
Expand Down

0 comments on commit 60b99ca

Please sign in to comment.