[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nc var types (NC_UNSPEC)



> :)
>
> I understand that NC_UNSPECIFIED is marked as private in the netcdf2.h file,
> but we have been using this nc_type type for our uninitialized variable
objects..
> the only reason to want to continue using this is because it shows up nicely
in
> debuggers... I can certainly fake something up, but it was nice to just use
the
> netcdf nc_type types...
>
> just some feedback :)

Leaving it out of the possibilities in the public interface enum means that
a user has to really work (cast) to put an invalid value in there.
E.G. the compiler finds problems in user code.

You can still
#define NC_UNSPECIFIED ((nc_type) 0)
and initialize uninitialized variables with that. Your debugger won't show
the string NC_UNSPECIFIED, but it should give you a clue...

-glenn