help / color / Atom feed
* mandoc: Initialize the local variable "act" in print_mdoc_node().
@ 2019-06-03 19:51 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-06-03 19:51 UTC (permalink / raw)
  To: source

Log Message:
Initialize the local variable "act" in print_mdoc_node().
While there is no bug, it helps clarity, and it is also safer in this
particular code because in case a bug gets introduced later, accessing
a NULL pointer is less dangerous than accessing an uninitialized pointer.

Michal Nowak <mnowak at startmail dot com> reported that gcc 4.4.4 
and 7.4.0 on illumos throw -Wuninitialized false positives.

Modified Files:

Revision Data
Index: mdoc_term.c
RCS file: /home/cvs/mandoc/mandoc/mdoc_term.c,v
retrieving revision 1.372
retrieving revision 1.373
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.372 -r1.373
--- mdoc_term.c
+++ mdoc_term.c
@@ -352,6 +352,7 @@ print_mdoc_node(DECL_ARGS)
 	 * produce output.  Note that some pre-handlers do so.
+	act = NULL;
 	switch (n->type) {
 	case ROFFT_TEXT:
 		if (n->flags & NODE_LINE) {
 To unsubscribe send an email to

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-03 19:51 mandoc: Initialize the local variable "act" in print_mdoc_node() schwarze

Archives are clonable: git clone --mirror

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone