-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pragma GCC diagnostic not allowed inside functions #14497
Comments
See the requirements to build from source. |
GCC 4.8 was released in March 2013, the toolchain is over 10 years old. Moreover, it is only shipped part of RHEL 7 which is EOL at the end of this month. I'm not sure if it makes sense for us to fix this. EDIT: Ah, I'm realizing this about trying to compile on GCC 4.1.2, which was released in 2007 |
At worse, @Jan1205, the best would be to stick to the last php version your system can build until the migration of your infra is done (ref. to the original ticket) ? |
The warnings are coming from the macros at https://github.com/php/php-src/blob/master/ext/libxml/php_libxml.h#L208 which is also in PHP 8.0 because it was part of a security fix. DOM is not the only place where you'll encounter that issue. One "solution" is to check the version number of the compiler and make the diagnostic macro a no-op if the compiler is too old. But as said earlier, I'm not so sure we should support a compiler from 2007 while our docs specify a minimum compiler version that's much more recent than that. |
As a side note, I'm not sure there has been a minimum version of GCC or Clang compilers defined anywhere for PHP yet. Because the Parle extension might have separate requirements. But this is also very good news that compilers get some required minimum version so it is more clear what is needed to build PHP. And the code can get slightly more simplified to avoid some manual checks with |
What do you think about making this macro a no-op on old GCC versions? |
Hm, I'm really not sure what would that affect. |
Note: I specifically meant the diagnostic macro, not the sanitize macro. |
No feedback was provided. The issue is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so. Thank you. |
Description
Description
Since PHP 8.2.20 with old compilers we have the following error:
/usr/local/src/php-8.2.20/ext/dom/document.c: In function ‘zim_DOMDocument_xinclude’:
/usr/local/src/php-8.2.20/ext/dom/document.c:1586:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1586:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1586:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1588:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1588:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1588:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c: In function ‘zim_DOMDocument_validate’:
/usr/local/src/php-8.2.20/ext/dom/document.c:1626:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1626:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1626:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1638:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1638:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1638:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c: In function ‘_dom_document_schema_validate’:
/usr/local/src/php-8.2.20/ext/dom/document.c:1673:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1673:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1673:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1678:4: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1678:4: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1678:4: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1684:4: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1684:4: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1684:4: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1705:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1705:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1705:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1726:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1726:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1726:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1732:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1732:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1732:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c: In function ‘_dom_document_relaxNG_validate’:
/usr/local/src/php-8.2.20/ext/dom/document.c:1803:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1803:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1803:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1810:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1810:2: error: #pragma GCC diagnostic not allowed inside functions
/usr/local/src/php-8.2.20/ext/dom/document.c:1810:2: error: #pragma GCC diagnostic not allowed inside functions
make: *** [ext/dom/document.lo] Fehler 1
Is there a chance to fix this? PHP 8.2.13 works for me.
PHP Version
PHP 8.2.20
Operating System
Unfortunately it is a very old system and version: gcc 4.1.2
see #11063
PHP Version
PHP 8.2.20
Operating System
No response
The text was updated successfully, but these errors were encountered: