Skip to content

ncgen does not ignore "secret" attributes #1504

@edhartnett

Description

@edhartnett

I ran ncgen -lc on an ncdump output. I had used the -s option with the ncdump output, so it contained hidden attributes.

ncgen then generates code that tries to set hidden attributes. This surprised me. I would have thought ncgen would be smart enough to ignore the hidden atts.

    stat = nc_put_att_text(ncid, NC_GLOBAL, "_Format", 1, "netCDF-4");
    check_err(stat,__LINE__,__FILE__);

Also when this code ran, the error message surprised me. I would have thought we had a message for trying to set a hidden attribute, but we get:

line 201 of tst_glm_ncgen_write.c: NetCDF: String match to name in use

Maybe we should have an error that says that this is a protected attribute name and should not be used by the user?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions