You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Charlie Zender note:
ncgen 4.3.3.1 works but 4.4.0 (today) fails to parse in.cdl.
i think this has been broken for many weeks in 4.4.0.
it seems possible that ncgen barfs when it encounters
values affixed with "l" for long when generating netcdf3 files.
however, i thought that bug had been fixed long ago and it
was decided that "l" means int when referring to netCDF3 files
for backwards compatibility to days when NC_LONG was the norm.
or maybe it's a different issue entirely.
file is attached.
chokes on line 705...
zender@givre:/nco/data$ ncgen -b -o in.nc in.cdl
ncgen: cdl line 705; NetCDF: Not a valid data type or _FillValue type
mismatch
(genbin.c:508)
zender@givre:/nco/data$ ncgen --version
ncgen: invalid option -- '-'
Usage: ncgen [-1] [-3] [-4] [-5] [-6] [-7] [-b] [-B buffersize] [-d] [-D
debuglevel] [-h] [-k kind ] [-l language=b|c|f77|java] [-M ] [-n]
[-o outfile] [-P] [-x] [file ... ]
netcdf library version 4.4.0-development of Nov 12 2015 14:22:53 $
Charlie Zender, Earth System Sci. & Computer Sci.
University of California, Irvine 949-891-2429 )'(
Without even looking at the code, I will claim responsibility
for this. The problem is that the long type is ambiguous in C.
On some machines, it is 32 bits, and on others it is 64 bits.
That is why the ll suffix is preferred because it is always 64 bits.
This is also one of the reasons that NC_LONG in netcdf.h is aliased
to NC_INT.
I will go ahead and add the 'l' suffix to ncgen.l as an alias to integer.
=Dennis Heimbigner
Unidata
Modified ncgen to properly handle the L and UL suffixes for integer constants
to keep backward compatibility. Now it is the case the single L suffix
(e.g. 111L) is treated as a 32 bit integer. This makes it consistent with
the fact that NC_LONG (netcdf.h) is an alias for NC_INT.
It is probable that .cdl files now exist that assumed that L prefix was
64 bits. This will cause problems.
Changes:
- ncgen.l - fix lexing involving L/LL suffix.
- misc. test cases: either .cdl files, or ncdump reference files or .c files.
- semantics.c: to fix type inference rules for untyped attributes
- ncdump: the code was dumping constant text using the L prefix.
Moving discussion of e-support PNU-748333 / Jira NCF-345 to Github issue.
The text was updated successfully, but these errors were encountered: