[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/27] dfa: improve -fanalyzer malloc checking
From: |
Bruno Haible |
Subject: |
Re: [PATCH 03/27] dfa: improve -fanalyzer malloc checking |
Date: |
Sat, 07 Aug 2021 15:03:51 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; ) |
> + * lib/canonicalize.h, lib/dfa.h:
> Add malloc-related attributes and include stdlib.h as needed.
More can be done in dfa.h:
2021-08-07 Bruno Haible <bruno@clisp.org>
dfa: Improve GCC 11 allocation-deallocation checking.
* lib/dfa.h (dfamust): Declare that deallocation must happen through
dfamustfree.
diff --git a/lib/dfa.h b/lib/dfa.h
index 28f9f63..edc39dc 100644
--- a/lib/dfa.h
+++ b/lib/dfa.h
@@ -88,13 +88,16 @@ extern void dfacopysyntax (struct dfa *, struct dfa const
*);
/* Parse the given string of given length into the given struct dfa. */
extern void dfaparse (char const *, ptrdiff_t, struct dfa *);
-/* Allocate and return a struct dfamust from a struct dfa that was
- initialized by dfaparse and not yet given to dfacomp. */
-extern struct dfamust *dfamust (struct dfa const *);
+struct dfamust;
/* Free the storage held by the components of a struct dfamust. */
extern void dfamustfree (struct dfamust *);
+/* Allocate and return a struct dfamust from a struct dfa that was
+ initialized by dfaparse and not yet given to dfacomp. */
+extern struct dfamust *dfamust (struct dfa const *)
+ _GL_ATTRIBUTE_DEALLOC (dfamustfree, 1);
+
/* Compile the given string of the given length into the given struct dfa.
The last argument says whether to build a searching or an exact matcher.
A null first argument means the struct dfa has already been
- [PATCH 01/27] backupfile: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 02/27] maint: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 03/27] dfa: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- Re: [PATCH 03/27] dfa: improve -fanalyzer malloc checking,
Bruno Haible <=
- [PATCH 04/27] dirname: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 05/27] exclude: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 06/27] filenamecat-lgpl: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 08/27] modechange: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 07/27] malloca: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 09/27] mountlist: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 10/27] pagalign_alloc: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01
- [PATCH 11/27] quotearg: improve -fanalyzer malloc checking, Paul Eggert, 2021/08/01