Bug #62346 [Com]: when using vac.C v11 get warning about redefine for __restrict__ in zend.h

From: Date: Mon, 14 Mar 2016 16:52:32 +0000
Subject: Bug #62346 [Com]: when using vac.C v11 get warning about redefine for __restrict__ in zend.h
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199822@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62346&edit=1 ID: 62346 Comment by: mamfelt at gmail dot com Reported by: mamfelt at gmail dot com Summary: when using vac.C v11 get warning about redefine for __restrict__ in zend.h Status: Open Type: Bug Package: Compile Warning Operating System: AIX PHP Version: 5.3.14 Block user comment: N Private report: N New Comment: Maybe the code in zend.h is no longer needed. I have tried to find " restrict" or "__restrict" in the .c and .h files. However, without something, the stderr is flooded with warnings. To better see what the compiler does I combined -E and -qinfo=all and got this excerpt: "/usr/include/standards.h", line 172.2: 1506-454 (I) if condition evaluates to 1. "/usr/include/standards.h", line 173.9: 1506-441 (I) The macro definition will override the keyword "__restrict__". #line 173 #define __restrict__ restrict "/data/prj/php/src/php-5.4.45/Zend/zend.h", line 179.10: 1506-441 (I) The macro definition will override the keyword "__restrict__". "/data/prj/php/src/php-5.4.45/Zend/zend.h", line 179.10: 1506-236 (W) Macro name __restrict__ has been redefined. "/data/prj/php/src/php-5.4.45/Zend/zend.h", line 179.10: 1506-358 (I) "__restrict__" is defined on line 173 of /usr/include/standards.h. "/data/prj/php/src/php-5.4.45/Zend/zend.h", line 180.2: 1506-460 (I) endif nesting level is 3. "/data/prj/php/src/php-5.4.45/Zend/zend.h", line 181.9: 1506-441 (I) The macro definition will override the keyword "restrict". "/data/prj/php/src/php-5.4.45/Zend/zend.h", line 183.2: 1506-460 (I) if nesting level is 3. #line 174 # define ZEND_FASTCALL #line 179 # define __restrict__ #define restrict __restrict__ #line 184 # define ZEND_ALLOCA_MAX_SIZE (32 * 1024) Maybe after nearly 4 years someone can look at this! Previous Comments: ------------------------------------------------------------------------ [2012-06-17 20:21:35] mamfelt at gmail dot com The patch is "very simple". It gets rid of endless messages. However, I do not know the importance of restrict or __restrict__ The solution may be much different. The AIX definition from /usr/include/standards.h is /* * Handle the use of the restrict keyword in non-C99 compilers */ #if ((__STDC_VERSION__ >= 199901L) || defined(__C99_RESTRICT)) #define __restrict__ restrict #else #define __restrict__ #endif Note: there are several ways to resolve the issue of the occainsional C++ comments in C code. But experience shows that when C++ comments are being used c89 is often not enough. If PHP is meant to be strictly C89 code - I could change the CFLAG to get rid of the messages - but just because gnu accepts both - with lots of help in zend.h it seems - does not make it better than one or the other. If PHP is meant to be "c89" rather than "c99" (with extensions) then I need to try with different compiler flags - because langval c99ext is wrong yes, I know I can add the flag -qcpluscmt instead - but I am told by people who "know" compilers that what we call c++ comments is officially an extension, not a core element. Thank you for your consideration. ------------------------------------------------------------------------ [2012-06-17 20:09:44] mamfelt at gmail dot com Description: ------------ "/data/prj/php-5.3.14/Zend/zend.h", line 179.10: 1506-358 (I) "__restrict__" is defined on line 186 of /usr/include/standards.h. Test script: --------------- export CFLAGS='-O2 -qlangval=extc99' ./configure --prefix=/opt --sysconfdir=/etc --mandir=/usr/share/man make Expected result: ---------------- "/data/prj/php-5.3.14/Zend/zend.h", line 179.10: 1506-358 (I) "__restrict__" is defined on line 186 of /usr/include/standards.h. but MANY MANY times ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62346&edit=1

« previous php.bugs (#199822) next »