From 3c23d3400e074cf29b4b7a38d43222203b3091c2 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 3 Jun 2023 13:07:31 +0200 Subject: [PATCH] classpath, csharpexec: Avoid "candidate for attribute 'malloc'" warning. * lib/classpath.h (set_classpath): Mark with attribute 'malloc'. --- ChangeLog | 5 +++++ lib/classpath.h | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fa13d3860b..5c1d3a1edf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-06-03 Bruno Haible + + classpath, csharpexec: Avoid "candidate for attribute 'malloc'" warning. + * lib/classpath.h (set_classpath): Mark with attribute 'malloc'. + 2023-06-03 Bruno Haible propername-lite: Improve documentation. diff --git a/lib/classpath.h b/lib/classpath.h index abcb4cbe40..65123140cf 100644 --- a/lib/classpath.h +++ b/lib/classpath.h @@ -15,6 +15,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +/* This file uses _GL_ATTRIBUTE_MALLOC. */ +#if !_GL_CONFIG_H_INCLUDED + #error "Please include config.h first." +#endif + /* Return the new CLASSPATH value. The given classpaths are prepended to the current CLASSPATH value. If use_minimal_classpath, the current CLASSPATH is ignored. */ @@ -25,7 +30,8 @@ extern char * new_classpath (const char * const *classpaths, /* Set CLASSPATH and returns a safe copy of its old value. */ extern char * set_classpath (const char * const *classpaths, unsigned int classpaths_count, - bool use_minimal_classpath, bool verbose); + bool use_minimal_classpath, bool verbose) + _GL_ATTRIBUTE_MALLOC; /* Restore CLASSPATH to its previous value. */ extern void reset_classpath (char *old_classpath); -- 2.39.5