bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

javaversion: Improve GCC 11 allocation-deallocation checking


From: Bruno Haible
Subject: javaversion: Improve GCC 11 allocation-deallocation checking
Date: Sat, 07 Aug 2021 21:47:30 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; )

2021-08-07  Bruno Haible  <bruno@clisp.org>

        javaversion: Improve GCC 11 allocation-deallocation checking.
        * lib/javaversion.h: Include <stdlib.h>.
        (javaexec_version): Declare that deallocation must happen through
        'free'.

diff --git a/lib/javaversion.h b/lib/javaversion.h
index ff55377..6983b28 100644
--- a/lib/javaversion.h
+++ b/lib/javaversion.h
@@ -18,6 +18,8 @@
 #ifndef _JAVAVERSION_H
 #define _JAVAVERSION_H
 
+#include <stdlib.h>
+
 
 #ifdef __cplusplus
 extern "C" {
@@ -28,7 +30,8 @@ extern "C" {
    This is the value of System.getProperty("java.specification.version").
    Some possible values are: 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 9, 10, 11.
    Return NULL if the Java version cannot be determined.  */
-extern char * javaexec_version (void);
+extern char * javaexec_version (void)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;
 
 
 #ifdef __cplusplus




reply via email to

[Prev in Thread] Current Thread [Next in Thread]