#54903 closed defect (fixed)
AtomicParsley @0.9.0: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *'
Reported by: | jpmelko | Owned by: | ken-cunningham-webuse |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | highsierra | Cc: | fracai |
Port: | AtomicParsley |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
Bacchus:~ root# /opt/local/bin/port upgrade AtomicParsley ---> Computing dependencies for AtomicParsley ---> Building AtomicParsley Error: Failed to build AtomicParsley: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_AtomicParsley/AtomicParsley/main.log for details. Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Attachments (1)
Change History (8)
Changed 7 years ago by jpmelko
comment:1 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|---|
Keywords: | highsierra added |
Port: | AtomicParsley added |
Summary: | Atomic Parsley won't bud on High Sierra → AtomicParsley @0.9.0: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *' |
comment:3 Changed 7 years ago by fracai
Cc: | fracai added |
---|
comment:4 Changed 7 years ago by wildyman
Please add the following lines to the end of the post-patch section of the Portfile to fix these build issues on High Sierra.
# fix initializing a variable of type 'char *' with an rvalue of type 'const char *' b0rked in High Sierra reinplace -locale en_US.ISO8859-1 -W ${worksrcpath} "s|= strrchr|= (char*)strrchr|g" AP_NSFile_utils.mm AP_NSImage.mm AtomicParsley.cpp
It appears that clang's Objective C and C++ now use the safe C++ version of 'strrchr' which returns a 'const char*' for the overloaded function version that accepts a string literal ('const char*'). This version is presumably intended to prevent unsafe or unintentional modification of immutable string literals through a non constant reference (pointer) to a substring. The C version returns 'char*' which silently drops the const. The explicit cast added in the reinplace above allows the potentially unsafe operation. A better solution might be to change the return variable type to 'const char*' for these variables to ensure that AtomicParsley isn't actually performing unsafe string operations. It would be better to fix this in the AtomicParsley source.
comment:6 Changed 7 years ago by ken-cunningham-webuse
Owner: | set to ken-cunningham-webuse |
---|---|
Resolution: | → fixed |
Status: | new → closed |
We also have an AtomicParsley-devel port, which is a newer development version. You could check whether it has the same problem.