schwehr / hdf5-old

Hierarchical Data Format (HDF) 5
Other
0 stars 0 forks source link

Do not define statics in headers #13

Open schwehr opened 10 years ago

schwehr commented 10 years ago

There should be no statics in headers. Need to create a source file and get these statics out of the headers and into source files. If there is a particular performance reason, there should be clear documentation as to why a static should be in a header.

find .. -name "*.h" | xargs grep static | wc -l
     218

Found via:

clang -DHAVE_CONFIG_H -I. -I../../hdf5-1.9.182/test -I../src  -I/sw/include    -UNDEBUG -DH5AC_DEBUG -DH5B_DEBUG -DH5B2_DEBUG -DH5D_DEBUG -DH5E_DEBUG -DH5F_DEBUG -DH5G_DEBUG -DH5HG_DEBUG -DH5HL_DEBUG -DH5I_DEBUG -DH5MF_DEBUG -DH5MM_DEBUG -DH5O_DEBUG -DH5P_DEBUG -DH5S_DEBUG -DH5T_DEBUG -DH5V_DEBUG -DH5Z_DEBUG -DH5_DEBUG_API -I../../hdf5-1.9.182/src -I../src -Werror=unused-function -Wall -Wextra   -MT tarray.o -MD -MP -MF .deps/tarray.Tpo -c -o tarray.o ../../hdf5-1.9.182/test/tarray.c
In file included from ../../hdf5-1.9.182/test/tarray.c:25:
../../hdf5-1.9.182/test/H5srcdir.h:74:20: error: unused function 'H5_get_srcdir' [-Werror,-Wunused-function]
static const char *H5_get_srcdir(void)