discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Jeffrey Walton <noloader@gmail.com>
Cc: discuss@mandoc.bsd.lv
Subject: Re: Dirty compile with GCC 7.5
Date: Thu, 2 Jul 2020 19:21:53 +0200
Message-ID: <20200702172153.GC65245@athene.usta.de> (raw)
In-Reply-To: <CAH8yC8msGm=OZiGYVp0hr9AG9L1hPzHBVp5OCfSUO1M=P3ZQqw@mail.gmail.com>

Hi Jeffrey,

Jeffrey Walton wrote on Thu, Jul 02, 2020 at 01:27:47AM -0400:

> tbl_html.c: In function "print_tbl":
> tbl_html.c:191:9: warning: "%d" directive output may be truncated
> writing between 1 and 10 bytes into a region of size 4
> [-Wformat-truncation=]
>         "%d", dp->hspans + 1);
>          ^~
> tbl_html.c:191:8: note: directive argument in the range [2, 2147483647]
>         "%d", dp->hspans + 1);
>         ^~~~

That's an obvious false positive from the compiler.
The number of spans cannot reasonably be larger than about ten.
If there are more than 9999 spans, well, then a smaller number will
be written into the "colspan" HTML attribute, which is perfectly
harmless.  A document containing a table with so many spans makes
no sense in the first place.

The code is explicitly annotated as

	(void)snprintf(...)

meaning that it was audited and it was determined that truncation
is harmless.

So, what is your point?

You failed to say why you reported this.

Do you suspect a bug?
If so, what do you think could go wrong?

Yours,
  Ingo
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv


      reply	other threads:[~2020-07-02 17:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02  5:27 Jeffrey Walton
2020-07-02 17:21 ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200702172153.GC65245@athene.usta.de \
    --to=schwarze@usta.de \
    --cc=discuss@mandoc.bsd.lv \
    --cc=noloader@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

discuss@mandoc.bsd.lv

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/mandoc-discuss

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 mandoc-discuss mandoc-discuss/ http://inbox.vuxu.org/mandoc-discuss \
		discuss@mandoc.bsd.lv
	public-inbox-index mandoc-discuss

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.mandoc.discuss


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git