gbranden pushed a commit to branch master
in repository groff.

commit 8bfcb6f7ace88050069f86cd61c1e1e4433bcb96
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Nov 27 15:48:47 2024 -0600

    [libgroff]: Be more scrupulous with `#include`s.
    
    * src/include/ptable.h: Include "<stdlib.h>" header, since the macros
      this file defines use `malloc()` and `free()`.
---
 ChangeLog            | 5 +++++
 src/include/ptable.h | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 58a681650..bc7090c6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-11-27  G. Branden Robinson <[email protected]>
+
+       * src/include/ptable.h: Include "<stdlib.h>" header, since the
+       macros this file defines use `malloc()` and `free()`.
+
 2024-11-27  G. Branden Robinson <[email protected]>
 
        * src/utils/addftinfo/addftinfo.cpp: Align with modern groff
diff --git a/src/include/ptable.h b/src/include/ptable.h
index b5a5d42e7..9cd951c9a 100644
--- a/src/include/ptable.h
+++ b/src/include/ptable.h
@@ -21,7 +21,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>. */
 #endif
 
 #include <assert.h>
-#include <string.h>
+#include <stdlib.h> // free(), malloc()
+#include <string.h> // strcmp(), strcpy(), strlen()
 
 // This groffism can be replaced with
 // std::unordered_map<const char *, T> if/when we migrate to C++11.

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to