[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mandoc-discuss
Subject:    Re: Dirty compile with GCC 7.5
From:       Ingo Schwarze <schwarze () usta ! de>
Date:       2020-07-02 17:21:53
Message-ID: 20200702172153.GC65245 () athene ! usta ! de
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic