netcdf-c/ncgen/Make0
dmh c99058741a [NCF-265]
Ncgen is unable to resolve
ambiguous references to an enum
constant when two different enums
have same econstant name.

Solved by allowing more specific
forms for econstant references.
1. /.../enumname.enumconstname
2. enumname.enumconstname
3. enumconstname

Case 1 is resolved by using the econstant
in the specific enum definition. If none is
found, an error is reported.

Case 2 is resolved by
1. finding an enclosing group with an
   enum definition with the specified name
   and containing the specified econstant.
   If there are more than one, then an error is reported
2. finding all enum definitions in the dataset that have
   the specified enum name and contain the specified
   econstant. If more than one is found, then an error is reported.
If the above two methods fail, then report an error.

Case 3 is similar to case 2, but all enums, irrespective
of name are used if they contains the specified enum constant.

The ref_tst_econst.cdl test in ncdump is causing ncdump
to fail. So there may be yet some problem.
2013-09-20 20:43:09 -06:00

47 lines
1.0 KiB
Plaintext

# Test c output
T=tim
#VG=valgrind --leak-check=full
#STDLIB=/usr/local
STDLIB=/share/ed/local/${HOST}
CFLAGS=-I../include -I${STDLIB}/include
LDFLAGS=../liblib/.libs/libnetcdf.a -L${STDLIB}/lib -lhdf5_hl -lhdf5 -lz -lm -lcurl
# -lcurl -lm -llber -lldap -lrt -lssl -lcrypto -ldl
CLASSPATH=".:ncCore-4.2.jar"
btest::
./ncgen -k3 -lb ${T}.cdl -o ${T}.nc
../ncdump/ncdump ./${T}.nc >${T}.dmp
diff -wBb ${T}.cdl ${T}.dmp
ctest::
./ncgen -k3 -lc ${T}.cdl >${T}.c
gcc -o ${T} ${CFLAGS} ${T}.c ${LDFLAGS}
./${T}
../ncdump/ncdump ./${T}.nc >${T}.dmp
diff -wBb ${T}.cdl ${T}.dmp
gtest::
./ncgen -k3 -lc ${T}.cdl >${T}.c
gcc -g -O0 -o ${T} ${CFLAGS} ${T}.c ${LDFLAGS}
gdb --args ./${T}
vctest::
gcc -o t ${CFLAGS} t.c ${LDFLAGS} -lm
${VG} ./t
../ncdump/ncdump ./t.nc |tee t.dmp
ftest::
./ncgen -k3 -lf77 ${T}.cdl >${T}.f77
gfortran -c ${CFLAGS} ${T}.f77
jtest::
./ncgen -lj ${T}.cdl >Main.java
javac -d . -classpath "${CLASSPATH}" Main.java
# java -cp ${CPATH} ./${T}
# ../ncdump/ncdump ./${T}.nc >${T}.dmp
# diff -wBb ${T}.cdl ${T}.dmp