NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

[netcdfgroup] Duplicate enumeration ids in same scope

This may just be my misunderstanding and trying to use the enum data type 
correctly, so sorry if I missed an obvious answer!

I created a simple cdl file with two enums:


netcdf enum_test{

      types:
        byte enum test1{pass=0, fail=1, undefined=2};
        byte enum test2{defined=0, undefined=1};
      variables:        
          test1 test1;
          test2 test2;
      data:
        test1=0;
          test2=1;
}


I then pass it through ncgen to check the syntax and get the following error 
message:

> ncgen enum_test.cdl
ncgen: enum_test.cdl line 4: Duplicate enumeration ids in same scope: /undefined

If I rename the second "undefined" to undefined_2, ncgen is happy but I am 
confused. 
It's not clear to me why I cannot use the same name value in different enum 
types. 
Is there something extra I need to do?

Any insights would be welcome.

Tim
  • 2013 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: