Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98265 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41722 invoked from network); 8 Feb 2017 16:33:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Feb 2017 16:33:02 -0000 Authentication-Results: pb1.pair.com header.from=rosenberger@taoweb.at; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rosenberger@taoweb.at; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain taoweb.at from 213.145.225.130 cause and error) X-PHP-List-Original-Sender: rosenberger@taoweb.at X-Host-Fingerprint: 213.145.225.130 host23.ssl-gesichert.at Received: from [213.145.225.130] ([213.145.225.130:44984] helo=host23.ssl-gesichert.at) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/04-33872-C384B985 for ; Wed, 08 Feb 2017 11:33:01 -0500 Received: (qmail 9326 invoked by uid 7799); 8 Feb 2017 17:32:57 +0100 Received: by simscan 1.4.0 ppid: 9289, pid: 9320, t: 0.0492s scanners: clamav: 0.99.2/m:57/d:23025 Received: from 188-22-81-45.adsl.highway.telekom.at (HELO toro) (rosenberger@taoweb.at@188.22.81.45) by host23.ssl-gesichert.at with SMTP; 8 Feb 2017 17:32:57 +0100 Message-ID: <1486571435.1827.47.camel@taoweb.at> To: Nikita Popov Cc: PHP Date: Wed, 08 Feb 2017 17:30:35 +0100 In-Reply-To: References: <1486558923.1827.39.camel@taoweb.at> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] php7 php_str_to_str warning: assignment makes pointer from integer without a cast From: rosenberger@taoweb.at (Torsten Rosenberger) Am Mittwoch, den 08.02.2017, 14:16 +0100 schrieb Nikita Popov: > On Wed, Feb 8, 2017 at 2:02 PM, Torsten Rosenberger eb.at> > wrote: > > > > > Hello > > > > prehistory: > > i tried to use php_str_to_str function to replace some character > > insteed of use call_user_func with str_replace > > > > in ext/standard/string.c > > PHPAPI zend_string *php_str_to_str(char *haystack, size_t length, > > char > > *needle, size_t needle_len, char *str, size_t str_len); > > > > so i expect a zend_string as result ? > > but when i build i got a warning: assignment makes pointer from > > integer > > without a cast > > > > buf = php_str_to_str(value,strlen(value),"y",1,"J",1); > >     ^ > > buf is: zend_string *buf; > > When buf is: int buf; i got no warning. > > > > i found 2 examples which looks like i have done > > ext/standard/var.c > > win32/sendmail.c > > > > You probably forgot to include the header declaring this function. If > C > does not have the declaration for a function, it assumes that it > returns > int. > thank's cannot see the wood for the trees know it works but with  buf = php_str_to_str(value, value_len, "'", 1, "\\x27", 4); i get a segfault buf = php_str_to_str(value, value_len, "'", 1, "\\x2", 3); works but not as i like i want to build a js escape function  should become  an so on BR/Torsten