NOAA-EMC / wgrib2

Provides functionality for interacting with, reading, writing, and manipulating GRIB2 files.
27 stars 13 forks source link

include guard missing on wgrib2.h file #83

Closed edwardhartnett closed 9 months ago

edwardhartnett commented 9 months ago

C header files need include guards so that users can include them in multiple code files, without duplicate definition problems. See https://en.wikipedia.org/wiki/Include_guard.

For example, at the top of netcdf.h:

ifndef NETCDF

define NETCDF

and at the bottom of the file:

endif / NETCDF /

This allows many files to include netcdf.h, but only the first time is the .h file actually scanned; once the first program that includes it is processed, the header does not need to be loaded again.

This is common practice in C header files.