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

NetCDF-C++4 API v.4.3.1: unused variable warning #85

Open
MetalKnight opened this issue Jan 3, 2020 · 1 comment
Open

NetCDF-C++4 API v.4.3.1: unused variable warning #85

MetalKnight opened this issue Jan 3, 2020 · 1 comment

Comments

@MetalKnight
Copy link

Hello, the latest C++4 APIs v.4.3.1 have the following compiler warning

netcdf4/include/ncGroup.h:18:14: error: ‘netCDF::file_id’ defined but not used [-Werror=unused-variable]
static int file_id;
^

which is preventing compilation with warning treated as errors in programs that compile and link against NetCDF shared objects + include files.

@MetalKnight
Copy link
Author

MetalKnight commented Jan 3, 2020

it seems that file_id was added in this commit
ecc2818

but its usage was then removed later on.

furthermore having a static variable in a .h is forcing a definition of the variable in every translation unit that include the .h files, therefore not only the library, but also its clients.

@MetalKnight MetalKnight changed the title NetCDF-C++4 API v.4.3.1: unused variable warning #1587 NetCDF-C++4 API v.4.3.1: unused variable warning Jan 3, 2020
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

No branches or pull requests

1 participant