public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Docs: Document that taint analyzer checker stops other checkers
@ 2022-03-22 18:13 Avinash Sonawane
  2022-03-22 23:15 ` David Malcolm
  0 siblings, 1 reply; 9+ messages in thread
From: Avinash Sonawane @ 2022-03-22 18:13 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

Hello!

$ man gcc says that "Some checkers are disabled by default (even with
-fanalyzer), such as the "taint" checker that implements
-Wanalyzer-tainted-array-index, and this option is required to enable
them." but still lists the -Wanalyzer-tainted-* checkers under
-fanalyzer saying "Enabling this option effectively enables the
following warnings:"

This patch comments out the tainted-* checkers so that when
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103533 gets fixed we can
remove the comment and list them under -fanalyzer

Also, the above wording suggests that `-fanalyzer
-fanalyzer-checker=taint` enables the taint checkers in addition to
the default checkers but currently, enabling -fanalyzer-checker=taint
stops other checkers. This patch documents that too.

Please find the attached patch.

Thanks!

Regards,
Avinash Sonawane (rootKea)
https://www.rootkea.me

[-- Attachment #2: 0001-Docs-Document-that-taint-analyzer-checker-stops-othe.patch --]
[-- Type: text/x-patch, Size: 1333 bytes --]

From 764baac8ffed188d50293f0991ab43c97b63cc8a Mon Sep 17 00:00:00 2001
From: Avinash Sonawane <rootkea@gmail.com>
Date: Tue, 22 Mar 2022 07:32:44 +0530
Subject: [PATCH] Docs: Document that taint analyzer checker stops other
 checkers

---
 gcc/doc/invoke.texi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4da4a1170f5..1996b54cf28 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -9666,11 +9666,13 @@ Enabling this option effectively enables the following warnings:
 -Wanalyzer-shift-count-negative @gol
 -Wanalyzer-shift-count-overflow @gol
 -Wanalyzer-stale-setjmp-buffer @gol
+@ignore
 -Wanalyzer-tainted-allocation-size @gol
 -Wanalyzer-tainted-array-index @gol
 -Wanalyzer-tainted-divisor @gol
 -Wanalyzer-tainted-offset @gol
 -Wanalyzer-tainted-size @gol
+@end ignore
 -Wanalyzer-unsafe-call-within-signal-handler @gol
 -Wanalyzer-use-after-free @gol
 -Wanalyzer-use-of-uninitialized-value @gol
@@ -10015,6 +10017,8 @@ such as the @code{taint} checker that implements
 @option{-Wanalyzer-tainted-array-index}, and this option is required
 to enable them.
 
+@emph{Note:} currently, @option{-fanalyzer-checker=taint} stops all other checkers.
+
 @item -fno-analyzer-feasibility
 @opindex fanalyzer-feasibility
 @opindex fno-analyzer-feasibility
-- 
2.32.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Docs: Document that taint analyzer checker stops other checkers
  2022-03-22 18:13 [PATCH] Docs: Document that taint analyzer checker stops other checkers Avinash Sonawane
@ 2022-03-22 23:15 ` David Malcolm
  2022-03-23  6:14   ` Avinash Sonawane
  0 siblings, 1 reply; 9+ messages in thread
From: David Malcolm @ 2022-03-22 23:15 UTC (permalink / raw)
  To: Avinash Sonawane, gcc-patches

On Tue, 2022-03-22 at 23:43 +0530, Avinash Sonawane via Gcc-patches
wrote:
> Hello!
> 
> $ man gcc says that "Some checkers are disabled by default (even with
> -fanalyzer), such as the "taint" checker that implements
> -Wanalyzer-tainted-array-index, and this option is required to enable
> them." but still lists the -Wanalyzer-tainted-* checkers under
> -fanalyzer saying "Enabling this option effectively enables the
> following warnings:"
> 
> This patch comments out the tainted-* checkers so that when
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103533 gets fixed we can
> remove the comment and list them under -fanalyzer
> 
> Also, the above wording suggests that `-fanalyzer
> -fanalyzer-checker=taint` enables the taint checkers in addition to
> the default checkers but currently, enabling -fanalyzer-checker=taint
> stops other checkers. This patch documents that too.
> 
> Please find the attached patch.
> 
Thanks for the patch.  I think it's a definite improvement in
readability for the end-user.  

The option and the docs refer to "checkers" e.g.
  "currently, -fanalyzer-checker=taint stops all other checkers"
but these checkers are an implementation detail of the analyzer; not
all of the analyzer warnings relate to a checker.

So it would be even better if the text listed the warnings that are
affected by this: basically all of the ones that are implemented in
checkers i.e. analyzer/sm-*.cc (apart from sm-taint, of course).

I can put that together if need be (but I'm about to sign off for today
and only just saw this patch).

Ideally, of course, we'd fix bug 103533, but that's GCC 13 material at
this point :)

Thanks again for the patch
Dave


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Docs: Document that taint analyzer checker stops other checkers
  2022-03-22 23:15 ` David Malcolm
@ 2022-03-23  6:14   ` Avinash Sonawane
  2022-03-23  6:17     ` Avinash Sonawane
  0 siblings, 1 reply; 9+ messages in thread
From: Avinash Sonawane @ 2022-03-23  6:14 UTC (permalink / raw)
  To: David Malcolm; +Cc: gcc-patches

On Tue, 22 Mar 2022 19:15:02 -0400
David Malcolm <dmalcolm@redhat.com> wrote:

> So it would be even better if the text listed the warnings that are
> affected by this: basically all of the ones that are implemented in
> checkers i.e. analyzer/sm-*.cc (apart from sm-taint, of course).

Done! I could find 13 warnings in analyzer/sm-*.cc. Hope I didn't miss
any. :)

I also rearranged some flags to maintain the sort order.

Please find the attached v2 of the patch. Should I post another
fresh mail with subject line "[PATCH v2] Docs:..."? Or should've the
subject of this current thread been edited to "[PATCH v2]" from
"[PATCH]"?

Sorry for bothering. This is my first time submitting the patch on a
mailing list. :)

Thanks!

Regards,
Avinash Sonawane (rootKea)
https://www.rootkea.me

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Docs: Document that taint analyzer checker stops other checkers
  2022-03-23  6:14   ` Avinash Sonawane
@ 2022-03-23  6:17     ` Avinash Sonawane
  2022-03-23 22:33       ` David Malcolm
  0 siblings, 1 reply; 9+ messages in thread
From: Avinash Sonawane @ 2022-03-23  6:17 UTC (permalink / raw)
  To: David Malcolm; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 53 bytes --]

Apologies! Forgot to attach the patch v2.

Done now.

[-- Attachment #2: 0001-Docs-Document-that-taint-analyzer-checker-disables-s.patch --]
[-- Type: text/x-patch, Size: 3277 bytes --]

From 1d986ffd8b20007a6a2140e50935ade1bebc2228 Mon Sep 17 00:00:00 2001
From: Avinash Sonawane <rootkea@gmail.com>
Date: Tue, 22 Mar 2022 07:32:44 +0530
Subject: [PATCH] Docs: Document that taint analyzer checker disables some
 warnings

---
 gcc/doc/invoke.texi | 33 +++++++++++++++++++++++++++------
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4da4a1170f5..1d16f0f167f 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -421,14 +421,13 @@ Objective-C and Objective-C++ Dialects}.
 -fanalyzer-checker=@var{name} @gol
 -fno-analyzer-feasibility @gol
 -fanalyzer-fine-grained @gol
--fanalyzer-state-merge @gol
--fanalyzer-state-purge @gol
+-fno-analyzer-state-merge @gol
+-fno-analyzer-state-purge @gol
 -fanalyzer-transitivity @gol
 -fanalyzer-verbose-edges @gol
 -fanalyzer-verbose-state-changes @gol
 -fanalyzer-verbosity=@var{level} @gol
 -fdump-analyzer @gol
--fdump-analyzer-stderr @gol
 -fdump-analyzer-callgraph @gol
 -fdump-analyzer-exploded-graph @gol
 -fdump-analyzer-exploded-nodes @gol
@@ -438,6 +437,7 @@ Objective-C and Objective-C++ Dialects}.
 -fdump-analyzer-feasibility @gol
 -fdump-analyzer-json @gol
 -fdump-analyzer-state-purge @gol
+-fdump-analyzer-stderr @gol
 -fdump-analyzer-supergraph @gol
 -Wno-analyzer-double-fclose @gol
 -Wno-analyzer-double-free @gol
@@ -9659,22 +9659,24 @@ Enabling this option effectively enables the following warnings:
 -Wanalyzer-free-of-non-heap @gol
 -Wanalyzer-malloc-leak @gol
 -Wanalyzer-mismatching-deallocation @gol
--Wanalyzer-possible-null-argument @gol
--Wanalyzer-possible-null-dereference @gol
 -Wanalyzer-null-argument @gol
 -Wanalyzer-null-dereference @gol
+-Wanalyzer-possible-null-argument @gol
+-Wanalyzer-possible-null-dereference @gol
 -Wanalyzer-shift-count-negative @gol
 -Wanalyzer-shift-count-overflow @gol
 -Wanalyzer-stale-setjmp-buffer @gol
+@ignore
 -Wanalyzer-tainted-allocation-size @gol
 -Wanalyzer-tainted-array-index @gol
 -Wanalyzer-tainted-divisor @gol
 -Wanalyzer-tainted-offset @gol
 -Wanalyzer-tainted-size @gol
+@end ignore
 -Wanalyzer-unsafe-call-within-signal-handler @gol
 -Wanalyzer-use-after-free @gol
--Wanalyzer-use-of-uninitialized-value @gol
 -Wanalyzer-use-of-pointer-in-stale-stack-frame @gol
+-Wanalyzer-use-of-uninitialized-value @gol
 -Wanalyzer-write-to-const @gol
 -Wanalyzer-write-to-string-literal @gol
 }
@@ -10015,6 +10017,25 @@ such as the @code{taint} checker that implements
 @option{-Wanalyzer-tainted-array-index}, and this option is required
 to enable them.
 
+@emph{Note:} currently, @option{-fanalyzer-checker=taint} disables following
+warnings from @option{-fanalyzer}:
+
+@gccoptlist{ @gol
+-Wanalyzer-double-fclose @gol
+-Wanalyzer-double-free @gol
+-Wanalyzer-exposure-through-output-file @gol
+-Wanalyzer-file-leak @gol
+-Wanalyzer-free-of-non-heap @gol
+-Wanalyzer-malloc-leak @gol
+-Wanalyzer-mismatching-deallocation @gol
+-Wanalyzer-null-argument @gol
+-Wanalyzer-null-dereference @gol
+-Wanalyzer-possible-null-argument @gol
+-Wanalyzer-possible-null-dereference @gol
+-Wanalyzer-unsafe-call-within-signal-handler @gol
+-Wanalyzer-use-after-free @gol
+}
+
 @item -fno-analyzer-feasibility
 @opindex fanalyzer-feasibility
 @opindex fno-analyzer-feasibility
-- 
2.32.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Docs: Document that taint analyzer checker stops other checkers
  2022-03-23  6:17     ` Avinash Sonawane
@ 2022-03-23 22:33       ` David Malcolm
  2022-03-24  5:11         ` Avinash Sonawane
  0 siblings, 1 reply; 9+ messages in thread
From: David Malcolm @ 2022-03-23 22:33 UTC (permalink / raw)
  To: Avinash Sonawane; +Cc: gcc-patches

On Wed, 2022-03-23 at 11:47 +0530, Avinash Sonawane wrote:
> Apologies! Forgot to attach the patch v2.
> 
> Done now.

Thanks for the patch! (forgetting to attach it is something of a rite
of passage)

The content of the v2 patch looks good to me; I tried regenerating the
manpage and I think it's a nice improvement in readability.  I double-
checked the options and I think you got it all correct.

I wondered if there's a dedicated syntax for adding a cautionary note
to a texinfo document, but there doesn't seem to be, so that part of
the patch is good as-is.

This is almost ready to push to trunk, but there are a couple of extra
tasks needed to be done:

(a) the patch needs a ChangeLog entry in its commit message to pass our
git hooks, giving a brief description of what the change is.  See
https://gcc.gnu.org/codingconventions.html#ChangeLogs
and you can use
  ./contrib/gcc-changelog/git_check_commit.py HEAD
to test that the ChangeLog message in the git commit will be pushable.

(b) the patch is now sufficiently large that it might be above the
threshold where the FSF cares about copyright, so please add a sign-off
line to the patch to certify that you wrote it (and various other legal
niceties).  See https://gcc.gnu.org/dco.html


Some more notes on GCC patches can be seen at:
https://gcc.gnu.org/contribute.html


Thanks again for the patch; let me know if anything's unclear.
Dave



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] Docs: Document that taint analyzer checker stops other checkers
  2022-03-23 22:33       ` David Malcolm
@ 2022-03-24  5:11         ` Avinash Sonawane
  2022-03-25  1:08           ` [committed] Docs: Document that taint analyzer checker disables some warnings [PR103533] David Malcolm
  0 siblings, 1 reply; 9+ messages in thread
From: Avinash Sonawane @ 2022-03-24  5:11 UTC (permalink / raw)
  To: David Malcolm; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

On Wed, 23 Mar 2022 18:33:38 -0400
David Malcolm <dmalcolm@redhat.com> wrote:
 
> This is almost ready to push to trunk, but there are a couple of extra
> tasks needed to be done:

Done.

Please find the attached v3 patch and let me know if something needs to
be changed/added. 

Thanks!

Regards,
Avinash Sonawane (rootKea)
https://www.rootkea.me

[-- Attachment #2: 0001-Docs-Document-that-taint-analyzer-checker-disables-s.patch --]
[-- Type: text/x-patch, Size: 3454 bytes --]

From 8248c65cab7d5de72152832d05cfe9b3f8299b40 Mon Sep 17 00:00:00 2001
From: Avinash Sonawane <rootkea@gmail.com>
Date: Tue, 22 Mar 2022 07:32:44 +0530
Subject: [PATCH] Docs: Document that taint analyzer checker disables some
 warnings

gcc/ChangeLog:
	* doc/invoke.texi: Document that enabling taint analyzer
	checker disables some warnings from `-fanalyzer`.

Signed-off-by: Avinash Sonawane <rootkea@gmail.com>
---
 gcc/doc/invoke.texi | 33 +++++++++++++++++++++++++++------
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4da4a1170f5..1d16f0f167f 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -421,14 +421,13 @@ Objective-C and Objective-C++ Dialects}.
 -fanalyzer-checker=@var{name} @gol
 -fno-analyzer-feasibility @gol
 -fanalyzer-fine-grained @gol
--fanalyzer-state-merge @gol
--fanalyzer-state-purge @gol
+-fno-analyzer-state-merge @gol
+-fno-analyzer-state-purge @gol
 -fanalyzer-transitivity @gol
 -fanalyzer-verbose-edges @gol
 -fanalyzer-verbose-state-changes @gol
 -fanalyzer-verbosity=@var{level} @gol
 -fdump-analyzer @gol
--fdump-analyzer-stderr @gol
 -fdump-analyzer-callgraph @gol
 -fdump-analyzer-exploded-graph @gol
 -fdump-analyzer-exploded-nodes @gol
@@ -438,6 +437,7 @@ Objective-C and Objective-C++ Dialects}.
 -fdump-analyzer-feasibility @gol
 -fdump-analyzer-json @gol
 -fdump-analyzer-state-purge @gol
+-fdump-analyzer-stderr @gol
 -fdump-analyzer-supergraph @gol
 -Wno-analyzer-double-fclose @gol
 -Wno-analyzer-double-free @gol
@@ -9659,22 +9659,24 @@ Enabling this option effectively enables the following warnings:
 -Wanalyzer-free-of-non-heap @gol
 -Wanalyzer-malloc-leak @gol
 -Wanalyzer-mismatching-deallocation @gol
--Wanalyzer-possible-null-argument @gol
--Wanalyzer-possible-null-dereference @gol
 -Wanalyzer-null-argument @gol
 -Wanalyzer-null-dereference @gol
+-Wanalyzer-possible-null-argument @gol
+-Wanalyzer-possible-null-dereference @gol
 -Wanalyzer-shift-count-negative @gol
 -Wanalyzer-shift-count-overflow @gol
 -Wanalyzer-stale-setjmp-buffer @gol
+@ignore
 -Wanalyzer-tainted-allocation-size @gol
 -Wanalyzer-tainted-array-index @gol
 -Wanalyzer-tainted-divisor @gol
 -Wanalyzer-tainted-offset @gol
 -Wanalyzer-tainted-size @gol
+@end ignore
 -Wanalyzer-unsafe-call-within-signal-handler @gol
 -Wanalyzer-use-after-free @gol
--Wanalyzer-use-of-uninitialized-value @gol
 -Wanalyzer-use-of-pointer-in-stale-stack-frame @gol
+-Wanalyzer-use-of-uninitialized-value @gol
 -Wanalyzer-write-to-const @gol
 -Wanalyzer-write-to-string-literal @gol
 }
@@ -10015,6 +10017,25 @@ such as the @code{taint} checker that implements
 @option{-Wanalyzer-tainted-array-index}, and this option is required
 to enable them.
 
+@emph{Note:} currently, @option{-fanalyzer-checker=taint} disables following
+warnings from @option{-fanalyzer}:
+
+@gccoptlist{ @gol
+-Wanalyzer-double-fclose @gol
+-Wanalyzer-double-free @gol
+-Wanalyzer-exposure-through-output-file @gol
+-Wanalyzer-file-leak @gol
+-Wanalyzer-free-of-non-heap @gol
+-Wanalyzer-malloc-leak @gol
+-Wanalyzer-mismatching-deallocation @gol
+-Wanalyzer-null-argument @gol
+-Wanalyzer-null-dereference @gol
+-Wanalyzer-possible-null-argument @gol
+-Wanalyzer-possible-null-dereference @gol
+-Wanalyzer-unsafe-call-within-signal-handler @gol
+-Wanalyzer-use-after-free @gol
+}
+
 @item -fno-analyzer-feasibility
 @opindex fanalyzer-feasibility
 @opindex fno-analyzer-feasibility
-- 
2.32.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [committed] Docs: Document that taint analyzer checker disables some warnings [PR103533]
  2022-03-24  5:11         ` Avinash Sonawane
@ 2022-03-25  1:08           ` David Malcolm
  2022-03-25  9:58             ` Tobias Burnus
  0 siblings, 1 reply; 9+ messages in thread
From: David Malcolm @ 2022-03-25  1:08 UTC (permalink / raw)
  To: Avinash Sonawane; +Cc: gcc-patches

From: Avinash Sonawane <rootkea@gmail.com>

On Thu, 2022-03-24 at 10:41 +0530, Avinash Sonawane wrote:
> On Wed, 23 Mar 2022 18:33:38 -0400
> David Malcolm <dmalcolm@redhat.com> wrote:
>  
> > This is almost ready to push to trunk, but there are a couple of
> > extra
> > tasks needed to be done:
> 
> Done.
> 
> Please find the attached v3 patch and let me know if something needs
> to
> be changed/added. 
> 
> Thanks!

I tweaked the wording: "disables following" to "disables the following",
added references to PR analyzer/103533 to the Subject and ChangeLog,
inspected the generated manpage, and ran it through a full bootstrap.

I've gone ahead and pushed it to trunk as r12-7808-g319ba7e241e7e2:
  https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=319ba7e241e7e21f9eb481f075310796f13d2035
(the patch I committed follows)

Thanks again!
Dave

gcc/ChangeLog:
	PR analyzer/103533
	* doc/invoke.texi: Document that enabling taint analyzer
	checker disables some warnings from `-fanalyzer`.

Signed-off-by: Avinash Sonawane <rootkea@gmail.com>
---
 gcc/doc/invoke.texi | 33 +++++++++++++++++++++++++++------
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 4da4a1170f5..8b16b35ec12 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -421,14 +421,13 @@ Objective-C and Objective-C++ Dialects}.
 -fanalyzer-checker=@var{name} @gol
 -fno-analyzer-feasibility @gol
 -fanalyzer-fine-grained @gol
--fanalyzer-state-merge @gol
--fanalyzer-state-purge @gol
+-fno-analyzer-state-merge @gol
+-fno-analyzer-state-purge @gol
 -fanalyzer-transitivity @gol
 -fanalyzer-verbose-edges @gol
 -fanalyzer-verbose-state-changes @gol
 -fanalyzer-verbosity=@var{level} @gol
 -fdump-analyzer @gol
--fdump-analyzer-stderr @gol
 -fdump-analyzer-callgraph @gol
 -fdump-analyzer-exploded-graph @gol
 -fdump-analyzer-exploded-nodes @gol
@@ -438,6 +437,7 @@ Objective-C and Objective-C++ Dialects}.
 -fdump-analyzer-feasibility @gol
 -fdump-analyzer-json @gol
 -fdump-analyzer-state-purge @gol
+-fdump-analyzer-stderr @gol
 -fdump-analyzer-supergraph @gol
 -Wno-analyzer-double-fclose @gol
 -Wno-analyzer-double-free @gol
@@ -9659,22 +9659,24 @@ Enabling this option effectively enables the following warnings:
 -Wanalyzer-free-of-non-heap @gol
 -Wanalyzer-malloc-leak @gol
 -Wanalyzer-mismatching-deallocation @gol
--Wanalyzer-possible-null-argument @gol
--Wanalyzer-possible-null-dereference @gol
 -Wanalyzer-null-argument @gol
 -Wanalyzer-null-dereference @gol
+-Wanalyzer-possible-null-argument @gol
+-Wanalyzer-possible-null-dereference @gol
 -Wanalyzer-shift-count-negative @gol
 -Wanalyzer-shift-count-overflow @gol
 -Wanalyzer-stale-setjmp-buffer @gol
+@ignore
 -Wanalyzer-tainted-allocation-size @gol
 -Wanalyzer-tainted-array-index @gol
 -Wanalyzer-tainted-divisor @gol
 -Wanalyzer-tainted-offset @gol
 -Wanalyzer-tainted-size @gol
+@end ignore
 -Wanalyzer-unsafe-call-within-signal-handler @gol
 -Wanalyzer-use-after-free @gol
--Wanalyzer-use-of-uninitialized-value @gol
 -Wanalyzer-use-of-pointer-in-stale-stack-frame @gol
+-Wanalyzer-use-of-uninitialized-value @gol
 -Wanalyzer-write-to-const @gol
 -Wanalyzer-write-to-string-literal @gol
 }
@@ -10015,6 +10017,25 @@ such as the @code{taint} checker that implements
 @option{-Wanalyzer-tainted-array-index}, and this option is required
 to enable them.
 
+@emph{Note:} currently, @option{-fanalyzer-checker=taint} disables the
+following warnings from @option{-fanalyzer}:
+
+@gccoptlist{ @gol
+-Wanalyzer-double-fclose @gol
+-Wanalyzer-double-free @gol
+-Wanalyzer-exposure-through-output-file @gol
+-Wanalyzer-file-leak @gol
+-Wanalyzer-free-of-non-heap @gol
+-Wanalyzer-malloc-leak @gol
+-Wanalyzer-mismatching-deallocation @gol
+-Wanalyzer-null-argument @gol
+-Wanalyzer-null-dereference @gol
+-Wanalyzer-possible-null-argument @gol
+-Wanalyzer-possible-null-dereference @gol
+-Wanalyzer-unsafe-call-within-signal-handler @gol
+-Wanalyzer-use-after-free @gol
+}
+
 @item -fno-analyzer-feasibility
 @opindex fanalyzer-feasibility
 @opindex fno-analyzer-feasibility
-- 
2.26.3


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [committed] Docs: Document that taint analyzer checker disables some warnings [PR103533]
  2022-03-25  1:08           ` [committed] Docs: Document that taint analyzer checker disables some warnings [PR103533] David Malcolm
@ 2022-03-25  9:58             ` Tobias Burnus
  2022-03-25 13:39               ` David Malcolm
  0 siblings, 1 reply; 9+ messages in thread
From: Tobias Burnus @ 2022-03-25  9:58 UTC (permalink / raw)
  To: David Malcolm, Avinash Sonawane; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 2969 bytes --]

This commit broke bootstrapping - well, at least kind of:
   make pdf   (and probably 'make dvi' and other formats using TeX)
now fails with:
> Runaway argument?
>
> -Wanalyzer-tainted-allocation-size @gol -Wanalyzer-tainted-array-inde@ETC.
> src/gcc-mainline/gcc/doc/invoke.texi:96
> 82: File ended while scanning use of @doignoretext.
The problem seems to be that when producing TeX output, the '...' of
   @gccoptlist{ ... }
ends up in a single line. Thus, '@ignore' is found but no
corresponding '<newline>@end ignore'.

Using '@c' has the same problem. And adding a line break will give
an error as  @gccoptlist  does not permit another paragraph in
the argument.

My solution is move the '@ignore' comment after the closing '}'.

Committed attached patch as obvious
as r12-7810-g748f36a48b506f52e10bcdeb750a7fe9c30c26f3

The culprit is the following change:

On 25.03.22 02:08, David Malcolm via Gcc-patches wrote:
> From: Avinash Sonawane <rootkea@gmail.com>
>
> On Thu, 2022-03-24 at 10:41 +0530, Avinash Sonawane wrote:
>> [...]
> [...]
>
> I've gone ahead and pushed it to trunk as r12-7808-g319ba7e241e7e2:
>    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=319ba7e241e7e21f9eb481f075310796f13d2035
> (the patch I committed follows)
> [...]
>
> gcc/ChangeLog:
>       PR analyzer/103533
>       * doc/invoke.texi: Document that enabling taint analyzer
>       checker disables some warnings from `-fanalyzer`.
> [...]
>
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> [...]
> @@ -9659,22 +9659,24 @@ Enabling this option effectively enables the following warnings:
>   -Wanalyzer-free-of-non-heap @gol
>   -Wanalyzer-malloc-leak @gol
>   -Wanalyzer-mismatching-deallocation @gol
> --Wanalyzer-possible-null-argument @gol
> --Wanalyzer-possible-null-dereference @gol
>   -Wanalyzer-null-argument @gol
>   -Wanalyzer-null-dereference @gol
> +-Wanalyzer-possible-null-argument @gol
> +-Wanalyzer-possible-null-dereference @gol
>   -Wanalyzer-shift-count-negative @gol
>   -Wanalyzer-shift-count-overflow @gol
>   -Wanalyzer-stale-setjmp-buffer @gol
> +@ignore
>   -Wanalyzer-tainted-allocation-size @gol
>   -Wanalyzer-tainted-array-index @gol
>   -Wanalyzer-tainted-divisor @gol
>   -Wanalyzer-tainted-offset @gol
>   -Wanalyzer-tainted-size @gol
> +@end ignore
>   -Wanalyzer-unsafe-call-within-signal-handler @gol
>   -Wanalyzer-use-after-free @gol
> --Wanalyzer-use-of-uninitialized-value @gol
>   -Wanalyzer-use-of-pointer-in-stale-stack-frame @gol
> +-Wanalyzer-use-of-uninitialized-value @gol
>   -Wanalyzer-write-to-const @gol
>   -Wanalyzer-write-to-string-literal @gol
>   }
> [...]

Tobias
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Attachment #2: committed.diff --]
[-- Type: text/x-patch, Size: 1845 bytes --]

commit 748f36a48b506f52e10bcdeb750a7fe9c30c26f3
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Fri Mar 25 10:47:49 2022 +0100

    doc/invoke.texi: Move @ignore block out of @gccoptlist [PR103533]
    
    With TeX output ("make pdf"), @gccoptlist's content end up in a single
    line such that TeX does not find the matching '@end ignore' for the
    '@ignore' block – failing with a runaway error. Solution is to move
    the @ignore block after the closing '}'.
    (Follow up to r12-7808-g319ba7e241e7e21f9eb481f075310796f13d2035 )
    
    gcc/
            PR analyzer/103533
            * doc/invoke.texi (Static Analyzer Options): Move
            @ignore block after @gccoptlist's '}' for 'make pdf'.

diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index afb21d9154c..28307105541 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -9667,13 +9667,6 @@ Enabling this option effectively enables the following warnings:
 -Wanalyzer-shift-count-negative @gol
 -Wanalyzer-shift-count-overflow @gol
 -Wanalyzer-stale-setjmp-buffer @gol
-@ignore
--Wanalyzer-tainted-allocation-size @gol
--Wanalyzer-tainted-array-index @gol
--Wanalyzer-tainted-divisor @gol
--Wanalyzer-tainted-offset @gol
--Wanalyzer-tainted-size @gol
-@end ignore
 -Wanalyzer-unsafe-call-within-signal-handler @gol
 -Wanalyzer-use-after-free @gol
 -Wanalyzer-use-of-pointer-in-stale-stack-frame @gol
@@ -9681,6 +9674,13 @@ Enabling this option effectively enables the following warnings:
 -Wanalyzer-write-to-const @gol
 -Wanalyzer-write-to-string-literal @gol
 }
+@ignore
+-Wanalyzer-tainted-allocation-size @gol
+-Wanalyzer-tainted-array-index @gol
+-Wanalyzer-tainted-divisor @gol
+-Wanalyzer-tainted-offset @gol
+-Wanalyzer-tainted-size @gol
+@end ignore
 
 This option is only available if GCC was configured with analyzer
 support enabled.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [committed] Docs: Document that taint analyzer checker disables some warnings [PR103533]
  2022-03-25  9:58             ` Tobias Burnus
@ 2022-03-25 13:39               ` David Malcolm
  0 siblings, 0 replies; 9+ messages in thread
From: David Malcolm @ 2022-03-25 13:39 UTC (permalink / raw)
  To: Tobias Burnus, Avinash Sonawane; +Cc: gcc-patches

On Fri, 2022-03-25 at 10:58 +0100, Tobias Burnus wrote:
> This commit broke bootstrapping - well, at least kind of:
>    make pdf   (and probably 'make dvi' and other formats using TeX)
> now fails with:
> > Runaway argument?
> > 
> > -Wanalyzer-tainted-allocation-size @gol 
> > -Wanalyzer-tainted-array-inde@ETC.
> > src/gcc-mainline/gcc/doc/invoke.texi:96
> > 82: File ended while scanning use of @doignoretext.
> The problem seems to be that when producing TeX output, the '...' of
>    @gccoptlist{ ... }
> ends up in a single line. Thus, '@ignore' is found but no
> corresponding '<newline>@end ignore'.
> 
> Using '@c' has the same problem. And adding a line break will give
> an error as  @gccoptlist  does not permit another paragraph in
> the argument.
> 
> My solution is move the '@ignore' comment after the closing '}'.
> 
> Committed attached patch as obvious
> as r12-7810-g748f36a48b506f52e10bcdeb750a7fe9c30c26f3 

Sorry about the breakage; thanks for fixing it.

Dave



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-03-25 13:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-22 18:13 [PATCH] Docs: Document that taint analyzer checker stops other checkers Avinash Sonawane
2022-03-22 23:15 ` David Malcolm
2022-03-23  6:14   ` Avinash Sonawane
2022-03-23  6:17     ` Avinash Sonawane
2022-03-23 22:33       ` David Malcolm
2022-03-24  5:11         ` Avinash Sonawane
2022-03-25  1:08           ` [committed] Docs: Document that taint analyzer checker disables some warnings [PR103533] David Malcolm
2022-03-25  9:58             ` Tobias Burnus
2022-03-25 13:39               ` David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).