On Sun, Jan 31, 2021 at 09:19:07PM +0100, Eric Botcazou wrote: > > Whatever works, I can't test such patches except on Linux, so can you just > > create a patch and test it on Solaris where it failed before? > > Maybe a safer fix is the attached one. Tested on old RedHat and SuSE distros. > > > * fold-const-call.c: Define __STDC_LIMIT_MACROS at the top.
But next time we use SIZE_MAX somewhere it is going to break again this way. If we just define SIZE_MAX if not defined after all includes in system.h, I think it is better than this. > diff --git a/gcc/fold-const-call.c b/gcc/fold-const-call.c > index da01759d9c8..c5f5566fa06 100644 > --- a/gcc/fold-const-call.c > +++ b/gcc/fold-const-call.c > @@ -17,6 +17,8 @@ You should have received a copy of the GNU General Public > License > along with GCC; see the file COPYING3. If not see > <http://www.gnu.org/licenses/>. */ > > +#define __STDC_LIMIT_MACROS /* For SIZE_MAX in C++. */ > + > #include "config.h" > #include "system.h" > #include "coretypes.h" Jakub