[php-src] PR #17521: Fix Clang builds regarding undefined function call

From: Date: Sun, 19 Jan 2025 14:05:40 +0000
Subject: [php-src] PR #17521: Fix Clang builds regarding undefined function call
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-30442@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/17521 Author: cmb69 While MSVC is apparently fine using _AddressOfReturnAddress() without including intrin.h, Clang complains that the function is undefined. So we include the header, if _MSC_VER is defined, what is the case for MSVC and clang-cl, but not for some other compilers on Windows (e.g. GCC). --- Note that this is related to https://github.com/php/php-src/commit/36857ab52b8cafc91650ccc55053abe6b517f092. It is indeed correct, that -fmodules declares some intrinsics (without -fmodules, hash_sha_ni.c and possibly others fail to build, even when I'm including intrin.h there). However, there are apparently no longer conflicting declarations in Clang (tested with 18.1.8), and without the include, I'm getting: ```` In file included from Zend\zend_constants.c:21: In file included from Zend\zend_constants.h:23: In file included from Zend\zend_globals.h:42: Zend\zend_call_stack.h(46,9): error: call to undeclared library function '_AddressOfReturnAddress' with type 'void *(void)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 46 | return _AddressOfReturnAddress(); | ^ Zend\zend_call_stack.h(46,9): note: include the header <intrin.h> or explicitly provide a declaration for '_AddressOfReturnAddress' 1 error generated. ````

« previous php.git-pulls (#30442) next »