NOAA-EMC / NCEPLIBS-bufr

The NCEPLIBS-bufr library contains routines and utilites for working with the WMO BUFR format.
Other
44 stars 19 forks source link

remove duplication of variable documentation in mstabs.h #497

Closed jbathegit closed 7 months ago

jbathegit commented 1 year ago

In this file we currently have every variable documented twice - once in the #ifdef IN_ARALLOCC block and once in the #else block. Rather than repeating all of this documentation in two places, it might be better to either

  1. use a @var approach like we use in cread.h, or
  2. try something kludgey like this:
#ifdef IN_ARALLOCC
  #define XTATTR extern
#else
  #define XTATTR
#endif

and then only define and document each variable one time as, e.g. XTATTR int nmtb_c, XTATTR char (*cbscl_c)[4], etc.

Personally, I think I'd prefer to try the first approach using @var.

edwardhartnett commented 1 year ago

What is normally done is to have the .h files define the externs, and then have the .c file which actually defines the var to define it in the .c file and not include the .h file.

This does not particually help with the documentation, but it's the way it's normally done...