+2023-06-02 Bruno Haible <bruno@clisp.org>
+
+ javacomp: Silence -Wanalyzer-possible-null-argument warning.
+ * lib/javacomp.c: Include verify.h.
+ (is_envjavac_gcj43_usable, is_envjavac_oldgcj_14_13_usable,
+ is_envjavac_nongcj_usable, compile_java_class): Assert that the
+ xasprintf results are non-NULL. This is possible since all involved
+ format strings are valid and don't use %ls, and all argument strings
+ are small compared to INT_MAX.
+ * modules/javacomp (Depends-on): Add verify.
+
2023-06-02 Bruno Haible <bruno@clisp.org>
striconveha: Don't crash if malloc() returns NULL.
#include "clean-temp.h"
#include "error.h"
#include "xvasprintf.h"
+#include "verify.h"
#include "c-strstr.h"
#include "gettext.h"
/* Try adding -fsource option if it is useful. */
char *javac_source =
xasprintf ("%s -fsource=%s", javac, source_version);
+ assume (javac_source != NULL);
unlink (compiled_file_name);
char *javac_target =
xasprintf ("%s -fsource=%s -ftarget=%s",
javac, source_version, target_version);
+ assume (javac_target != NULL);
unlink (compiled_file_name);
unlink (compiled_file_name);
javac_noassert = xasprintf ("%s -fno-assert", javac);
+ assume (javac_noassert != NULL);
java_sources[0] = conftest_file_name;
if (!compile_using_envjavac (javac_noassert,
/* Try adding -source option if it is useful. */
char *javac_source =
xasprintf ("%s -source %s", javac, source_version_for_javac);
+ assume (javac_source != NULL);
unlink (compiled_file_name);
option but no -source option.) */
char *javac_target =
xasprintf ("%s -target %s", javac, target_version);
+ assume (javac_target != NULL);
unlink (compiled_file_name);
/* Try adding -source option if it is useful. */
char *javac_target_source =
xasprintf ("%s -source %s", javac_target, source_version_for_javac);
+ assume (javac_target_source != NULL);
unlink (compiled_file_name);
higher.) */
char *javac_target_source =
xasprintf ("%s -source %s", javac_target, source_version_for_javac);
+ assume (javac_target_source != NULL);
unlink (compiled_file_name);
fsource_option ? source_version : "",
ftarget_option ? " -ftarget=" : "",
ftarget_option ? target_version : ""));
+ assume (javac_with_options != NULL);
err = compile_using_envjavac (javac_with_options,
java_sources, java_sources_count,