Re: [PATCH] analyzer PR 106003

2022-07-14 Thread David Malcolm via Gcc
On Thu, 2022-06-23 at 19:20 -0400, David Malcolm wrote: > On Fri, 2022-06-24 at 00:00 +0530, Mir Immad wrote: [...snip...] > > + > > +enum access_mode > > +fd_state_machine::get_access_mode_from_flag (int flag) const > > +{ > > +  /* FIXME: this code assumes the access modes on the host and > > +

Re: [PATCH] analyzer PR 106003

2022-06-27 Thread David Malcolm via Gcc
Thanks for the updated patch. Various notes below; mostly nits, but I realized there's a logic error in fd_state_machine::on_condition that I hadn't spotted before... [...snip...] > diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog > index 53b3ffb487b..d30e94f2f62 100644 > --- a/gcc/a

[PATCH] analyzer PR 106003

2022-06-27 Thread Mir Immad via Gcc
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index b6dcc45a58a..04631f737ea 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1269,6 +1269,7 @@ ANALYZER_OBJS = \ analyzer/region-model-reachability.o \ analyzer/sm.o \ analyzer/sm-file.o \ + analyzer/sm-fd.o \ analyzer/sm-malloc.o \

Re: [PATCH] analyzer PR 106003

2022-06-27 Thread Mir Immad via Gcc
Thanks for the suggestions, Dave. +} > + else > +{ > + /* FIXME: add leak reporting */ > +} > +} > + > Please add a testcase for this, with an "xfail" in the dg-warning > directive. I fixed it and made other suggested changes. All the tests (for fds) are passing. Sending an up

Re: [PATCH] analyzer PR 106003

2022-06-26 Thread David Malcolm via Gcc
Thanks for the updated patch. Various comments inline below. Sorry if this seems nitpicky in places. I think the patch is nearly ready; please write a ChangeLog entry for the next one (none of my proposed changes are going to affect what the ChangeLog will look like, apart from new test case fil

[PATCH] analyzer PR 106003

2022-06-25 Thread Mir Immad via Gcc
diff --git a/gcc/Makefile.in b/gcc/Makefile.in index b6dcc45a58a..04631f737ea 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1269,6 +1269,7 @@ ANALYZER_OBJS = \ analyzer/region-model-reachability.o \ analyzer/sm.o \ analyzer/sm-file.o \ + analyzer/sm-fd.o \ analyzer/sm-malloc.o \

Re: [PATCH] analyzer PR 106003

2022-06-23 Thread David Malcolm via Gcc
On Fri, 2022-06-24 at 00:00 +0530, Mir Immad wrote: Thanks for the updated patch. This is close to being ready. One big issue is the target hook idea for isolating the target's definition of the O_* flags as per Joseph's suggestion here: https://gcc.gnu.org/pipermail/gcc/2022-June/238961.html

[PATCH] analyzer PR 106003

2022-06-23 Thread Mir Immad via Gcc
diff --git gcc/Makefile.in gcc/Makefile.in index b6dcc45a58a..04631f737ea 100644 --- gcc/Makefile.in +++ gcc/Makefile.in @@ -1269,6 +1269,7 @@ ANALYZER_OBJS = \ analyzer/region-model-reachability.o \ analyzer/sm.o \ analyzer/sm-file.o \ + analyzer/sm-fd.o \ analyzer/sm-malloc.o \ analyzer