Bug #80197 [Com]: implicit declaration of function 'magic_stream' is invalid

From: Date: Wed, 07 Oct 2020 11:54:30 +0000
Subject: Bug #80197 [Com]: implicit declaration of function 'magic_stream' is invalid
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229443@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80197&edit=1 ID: 80197 Comment by: mkoula@php.net Reported by: mkoula@php.net Summary: implicit declaration of function 'magic_stream' is invalid Status: Open Type: Bug Package: PHP options/info functions Operating System: macOS Catalina 10.15.7 PHP Version: 8.0.0rc1 Block user comment: N Private report: N New Comment: I did a diff of this file between beta and rc and the result is: ❯ diff /Users/mIREK/compile/php8/php-8.0.0rc1/ext/fileinfo/fileinfo.c /Users/mIREK/compile/php8/php-8.0.0beta3/ext/fileinfo/fileinfo.c 74,75c74,75 < zend_throw_error(NULL, "Invalid finfo object"); \ < RETURN_THROWS(); \ --- > php_error_docref(NULL, E_WARNING, "The invalid fileinfo object."); \ > RETURN_FALSE; \ 273c273 < php_error_docref(NULL, E_WARNING, "Failed to load magic database at \"%s\"", file); --- > php_error_docref(NULL, E_WARNING, "Failed to load magic database at > '%s'.", file); 385c385 < php_error_docref(NULL, E_WARNING, "Failed to load magic database"); --- > php_error_docref(NULL, E_WARNING, "Failed to load magic database."); 447c447 < zend_argument_type_error(1, "must not contain any null bytes"); --- > zend_argument_type_error(1, "must not contain null bytes"); So before it was Just warning and now it throws error, but I am not any C developer, I just can see that this was changed... Previous Comments: ------------------------------------------------------------------------ [2020-10-07 11:45:19] mkoula@php.net Description: ------------ I previously compiled 8.0.0beta3 and worked fine. Today I run the same configuration on 8.0.0rc1 and configure went through fine and then when I ran make command it died with the message: /Users/mIREK/compile/php8/php-8.0.0rc1/ext/fileinfo/fileinfo.c:429:24: error: implicit declaration of function 'magic_stream' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ret_val = (char *) magic_stream(magic, stream); ^ /Users/mIREK/compile/php8/php-8.0.0rc1/ext/fileinfo/fileinfo.c:429:24: note: did you mean 'magic_setparam'? /opt/local/include/magic.h:153:5: note: 'magic_setparam' declared here int magic_setparam(magic_t, int, const void *); ^ /Users/mIREK/compile/php8/php-8.0.0rc1/ext/fileinfo/fileinfo.c:429:15: warning: cast to 'char *' from smaller integer type 'int' [-Wint-to-pointer-cast] ret_val = (char *) magic_stream(magic, stream); ^ /Users/mIREK/compile/php8/php-8.0.0rc1/ext/fileinfo/fileinfo.c:477:25: error: implicit declaration of function 'magic_stream' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ret_val = (char *)magic_stream(magic, stream); ^ /Users/mIREK/compile/php8/php-8.0.0rc1/ext/fileinfo/fileinfo.c:477:17: warning: cast to 'char *' from smaller integer type 'int' [-Wint-to-pointer-cast] ret_val = (char *)magic_stream(magic, stream); ^ 2 warnings and 2 errors generated. make: *** [ext/fileinfo/fileinfo.lo] Error 1 As a configure I used this, which for beta worked fine: ./configure \ --prefix=/opt/local \ --sysconfdir=/opt/local/php80 \ --program-suffix=80 \ --with-config-file-path=/opt/local/etc/php80 \ --with-config-file-scan-dir=/opt/local/etc/php80/conf.d \ --enable-bcmath \ --enable-calendar \ --enable-exif \ --enable-ftp \ --enable-fpm \ --enable-gd \ --enable-intl \ --enable-mbregex \ --enable-mbstring \ --enable-mysqlnd \ --enable-pcntl \ --enable-soap \ --enable-sockets \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-opcache \ --with-curl \ --with-fpm-user=_www \ --with-fpm-group=_www \ --with-freetype \ --with-iconv=/opt/local \ --with-libxml \ --with-jpeg \ --with-layout=GNU \ --with-mysql-sock=/tmp/mysql.sock \ --with-openssl \ --with-pdo-mysql=mysqlnd \ --with-pdo-pgsql=/opt/local/lib/postgresql12 \ --with-pdo-sqlite \ --with-pgsql=/opt/local/lib/postgresql12 \ --with-pic \ --with-sqlite3 \ --with-webp \ --with-xsl \ --with-zip \ --with-zlib ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80197&edit=1

« previous php.bugs (#229443) next »