From 59476ba79f7d3e8beff8fb4c5a684589dc29b99f Mon Sep 17 00:00:00 2001 From: Luigi Scarso Date: Thu, 12 Mar 2020 01:13:01 +0000 Subject: sync with upstream luatex rev. 7306. git-svn-id: svn://tug.org/texlive/trunk@54249 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/mplibdir/ChangeLog | 5 ++++- Build/source/texk/web2c/mplibdir/mp.w | 11 ++--------- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'Build/source/texk/web2c/mplibdir') diff --git a/Build/source/texk/web2c/mplibdir/ChangeLog b/Build/source/texk/web2c/mplibdir/ChangeLog index b6f1945f17a..a03ed1ac9ec 100644 --- a/Build/source/texk/web2c/mplibdir/ChangeLog +++ b/Build/source/texk/web2c/mplibdir/ChangeLog @@ -1,7 +1,10 @@ +2020-02-18 Luigi Scarso + * better mp_snprintf macro + + 2019-03-06 Luigi Scarso * Code clean-up. - 2019-02-06: Taco Hoekwater * New primitive void: convert a suffix to a boolean. Work in progress. diff --git a/Build/source/texk/web2c/mplibdir/mp.w b/Build/source/texk/web2c/mplibdir/mp.w index 279739f8569..69eeb571f8b 100644 --- a/Build/source/texk/web2c/mplibdir/mp.w +++ b/Build/source/texk/web2c/mplibdir/mp.w @@ -2960,15 +2960,8 @@ void *mp_xmalloc (MP mp, size_t nmem, size_t size) { } @ @= -/*int mp_snprintf_res ;*/ -/* Some compilers (i.e. gcc 8.2.0 ) complained with the old */ -/* #define mp_snprintf (void)snprintf */ -/* about truncation. For the moment we store the result. */ -/*# define mp_snprintf mp_snprintf_res=snprintf */ -/* Now gcc 10 does't like common symbols, so we switch back */ -/* to the old define. */ -#define mp_snprintf (void)snprintf - +/* Avoid warning on format truncation */ +#define mp_snprintf(...) (snprintf(__VA_ARGS__) < 0 ? abort() : (void)0) @* Dynamic memory allocation. -- cgit v1.2.3