Opened 9 years ago

Closed 5 years ago

#6105 closed defect (wontfix)

Make a versions of importFromWkt and importFromWkb that have const args.

Reported by: Kurt Schwehr Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

Really, this is more of a question, but I figured the title should be a request for an action.

In both OSR and OGR:

Why is it that importFromWkt and Wkb have non const args? The code in the import really shouldn't be modifying the Wkt or Wkb while it parses it. The first thing that these methods do is to make a const char *pszInput from *ppszInput.

e.g.

OGRErr OGR_SRSNode::importFromWkt( char ** ppszInput, int nRecLevel, int* pnNodes )

{
    const char  *pszInput = *ppszInput;

Change History (2)

comment:1 by Even Rouault, 9 years ago

I think the issue is backward incompatibility. OGR_SRSNode is mainly an internal detail, so we are free sanitzing stuff at this level. OGRSpatialReference is public. But we could probably provide a const safe version, and keep the older one as deprecated, as I think that would be legal in C++ (2 different signatures ?)

comment:2 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.