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

compiler warning: variable length arrays #214

Closed
dschlaep opened this issue Jul 13, 2018 · 1 comment
Closed

compiler warning: variable length arrays #214

dschlaep opened this issue Jul 13, 2018 · 1 comment

Comments

@dschlaep
Copy link
Member

with clang==: warning: variable length arrays are a C99 feature [-Wvla-extension]
with g++: warning: ISO C++ forbids variable length array ‘outfmt’ [-Wvla]

@dschlaep dschlaep added this to the Code testing milestone Jul 13, 2018
@dschlaep
Copy link
Member Author

Note: clang++ uses -Wvla-extension whereas g++ uses -Wvla and they are incompatible

dschlaep added a commit that referenced this issue Jul 17, 2018
Better compilation and use in rSOILWAT2

we have three documented and suppressed/ignored problems:
- memory leak (use of a suppression file): #205
- compile warning #208: treating c input as c++
- compile warning #214: variable array length
@nip5 nip5 self-assigned this Feb 21, 2019
@dschlaep dschlaep assigned dschlaep and unassigned nip5 Apr 27, 2019
dschlaep added a commit that referenced this issue Apr 27, 2019
- replace new constant `OVER_SIZE` introduced with commit 2369858 by existing and appropriate `MAX_LAYERS` for all previous Variable-length arrays used for soil layers

- renamed constant `STR_OVER_SIZE` to `ERRSTRLEN` to indicate use (now moved to `filefuncs.h` and commented use by function `LogError`

-> this commit produces identical output as `master` v4.2.3
```
make clean bin bint_run
diff testing/Output/ testing/Output_ref/ -qs
```

--> this commit eliminated all variable length arrays compiler warnings on my local system under both gcc and clang
--> confirm that is true for CIs as well and then close issue #214 if confirmed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants