#6002 closed defect (fixed)
ogr_autocad_services.cpp has incorrect logic on a C++14 compiler
Reported by: | etresoft | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.0.1 |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
The C++ std::string::assign method has changed in C++14. The ACAdjustText method is relying on cast to a C string in its assign operations. While ogr_autocad_services.cpp still compiles, but now uses a different assign method resulting in incorrect logic. I found the error while building and testing GDAL on Xcode 6.3.2. I am building the 1.11.2 branch, but the same logic seems to be present in the 2.0 branch.
Attachments (1)
Change History (5)
by , 8 years ago
Attachment: | 0001-Make-compatible-with-C-14.patch added |
---|
comment:1 by , 8 years ago
PS: I was comparing tests against Linux running Ubuntu 14.04. The new code doesn't seem to have broken the Linux build.
comment:2 by , 8 years ago
comment:3 by , 8 years ago
Milestone: | → 2.0.1 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:4 by , 8 years ago
Post analysis: the issue is with C++14 only.
The culprit here is was our use of the CPLString class extending std::string with a implicit conversion operator to const char*.
Previously string& assign (const char* s, size_t n) was used when a CPLString was passed. But in C++14, string& assign (const string& str, size_t subpos, size_t sublen = npos) was now used since the sublen argument became optional.
Patch file for C++ compatibility.