NSF Unidata

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

[netCDF #PUM-976132]: Compile problems with NetCDF 3.6.3 and gcc's

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.



Sean,

This is all kind of academic since I've now changed the code to use strlcat(),
and
it seems to work.  I still have to check that it now passes gcc
-D_FORTIFY_DOURCE=2,
as I suspect there may be more issues after this one.

In answer to your question, yes I really have to advance sp.  The purpose of
the
decodify function is to change netCDF names with special characters in them,
such
as "relative humidity (%)" to strings that can be used for variable names in
generated C and Fortran code, such as
"relative_SPACE_humidity_SPACE__LEFTPAREN__PERCENT__RIGHTPAREN_", and for this
purpose, it's necessary to have a cursor (cp) moving along in the name as
another cursor (sp) is moving along in the newname.  There may be a better way
to do it, but I think the change to using strlcat() improved things.

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: PUM-976132
Department: Support netCDF
Priority: Normal
Status: Closed