GSoC: Extending the Static Analysis Pass

2022-04-03 Thread Tim Lange
Hi everyone, Hi David, I'm interested in extending the static analysis pass as a GSoC project. Short introduction of me: I'm Tim, currently doing my master in computer science with focus on IT security at TU Darmstadt. I already worked with IFDS as part of my bachelor thesis and took both prog

GSoC

2022-06-09 Thread Tim Lange
Hi everyone, my name is Tim and I'm also working on the static analyzer this summer. Some of you might already noticed my nooby questions in the IRC ;). Specifically, I'll be working on extending the analyzer with several smaller warnings that the clang analyzer already has. David created a me

fanalyzer: debugging zero state machine

2022-06-09 Thread Tim Lange
> On Mi, Jun 8 2022 at 11:12:52 -0400, David Malcolm wrote: > > On Wed, 2022-06-08 at 01:42 +0200, Tim Lange wrote: > > > > Hi Dave, > > > > I did spent some time to think about the zero state machine. I first > > thought about distinguishing between

Re: fanalyzer: debugging zero state machine

2022-06-12 Thread Tim Lange
On Do, Jun 9 2022 at 13:40:06 -0400, David Malcolm wrote: On Thu, 2022-06-09 at 16:49 +0200, Tim Lange wrote: > On Mi, Jun 8 2022 at 11:12:52 -0400, David Malcolm wrote: > > On Wed, 2022-06-08 at 01:42 +0200, Tim Lange wrote: > > > > Hi Dave, Hi Tim; var

[RFC] analyzer: allocation size warning

2022-06-17 Thread Tim Lange
allocation-size-2.c: New test. * gcc.dg/analyzer/allocation-size-3.c: New test. * gcc.dg/analyzer/allocation-size-4.c: New test. Signed-off-by: Tim Lange --- gcc/analyzer/analyzer.opt | 4 + gcc/analyzer/sm-malloc.cc | 363 +- .../gcc.dg/analyzer/allocation-size-1.c |

[RFC] analyzer: add allocation size warning

2022-06-17 Thread Tim Lange
mentation for foo and bar. * gcc.dg/analyzer/allocation-size-1.c: New test. * gcc.dg/analyzer/allocation-size-2.c: New test. * gcc.dg/analyzer/allocation-size-3.c: New test. * gcc.dg/analyzer/allocation-size-4.c: New test. Signed-off-by: Tim Lange ---

Re: [RFC] analyzer: allocation size warning

2022-06-17 Thread Tim Lange
On Fr, Jun 17 2022 at 22:45:42 +0530, Prathamesh Kulkarni wrote: On Fri, 17 Jun 2022 at 21:25, Tim Lange wrote: Hi everyone, Hi Tim, Thanks for posting the POC patch! Just a couple of comments (inline) Hi Prathamesh, thanks for looking at it. tracked in PR105900 [0], I'd li

Re: [RFC] analyzer: allocation size warning

2022-06-17 Thread Tim Lange
On Fri, Jun 17, 2022 at 01:48:09PM -0400, David Malcolm wrote: > On Fri, 2022-06-17 at 17:54 +0200, Tim Lange wrote: > > Hi everyone, > > Hi Tim. > > Thanks for the patch. > > Various comments inline below, throughout... > > > > > tracked in PR105

Re: [RFC] analyzer: allocation size warning

2022-06-21 Thread Tim Lange
On Sat Jun 18, 2022 at 12:13 AM CEST, David Malcolm wrote: > On Fri, 2022-06-17 at 22:23 +0200, Tim Lange wrote: > > On Fri, Jun 17, 2022 at 01:48:09PM -0400, David Malcolm wrote: > > > On Fri, 2022-06-17 at 17:54 +0200, Tim Lange wrote: > > [...snip...] > > > &g

Re: [RFC] analyzer: allocation size warning

2022-06-22 Thread Tim Lange
ue easily. Deferring the whole pop_frame to the before node breaks the assumptions inside exploded_graph::get_or_create_node. I don't know what's the best/elegant way of solving this. Is a solution to attach the return svalue to the return edge and then use it later in the PK_BEFORE

[PATCH v2] analyzer: add allocation size checker

2022-06-29 Thread Tim Lange
ize-2.c: New test. * gcc.dg/analyzer/allocation-size-3.c: New test. * gcc.dg/analyzer/allocation-size-4.c: New test. * gcc.dg/analyzer/allocation-size-5.c: New test. Signed-off-by: Tim Lange --- gcc/analyzer/analyzer.opt | 4 + gcc/analyzer/checker-pat

Re: [PATCH v2] analyzer: add allocation size checker

2022-06-30 Thread Tim Lange
On Wed Jun 29, 2022 at 7:39 PM CEST, David Malcolm wrote: > On Wed, 2022-06-29 at 17:39 +0200, Tim Lange wrote: > > > Hi, > > Thanks for the updated patch. > > Overall, looks nearly ready; various nits inline below, throughout... > > > > > I've

[PATCH v3] analyzer: add allocation size checker [PR105900]

2022-06-30 Thread Tim Lange
Hi, here's the updated patch that should address all the comments from the v2. - Tim This patch adds an checker that warns about code paths in which a buffer is assigned to a incompatible type, i.e. when the allocated buffer size is not a multiple of the pointee's size. 2022-07-30

Re: Setting up editors for the GNU/GCC coding style?

2022-07-28 Thread Tim Lange
On Thu, Jul 28 2022 at 02:46:58 PM -0400, David Malcolm via Gcc wrote: Is there documentation on setting up text editors to work with our coding style? A lot of the next generation of developers aren't using vi or emacs; they's using VS Code, CLion, and other editors. Does anyone have docs

GCC warns on defined behavior with Wrestrict?

2022-07-29 Thread Tim Lange
Hi everyone, while testing a new buffer overlap and restrict checker in the analyzer, it emitted a warning inside coreutils. During the discussion [0], Paul Eggert posted a link to the current draft of the next C standard [1] with new examples for the definition of 'restrict'. Especially example 3

Usage of the C++ stdlib unordered_map in GCC

2022-08-30 Thread Tim Lange
Hello, I was preparing a patch for GCC and used the unordered_map from the C++ stdlib in my patch. Later on, I noticed that it is used nowhere else inside GCC except for some files in the go frontend. I wondered, now that building GCC requires a C++11 host compiler, whether there is a consen

Re: Usage of the C++ stdlib unordered_map in GCC

2022-08-31 Thread Tim Lange
On Mi, Aug 31 2022 at 10:35:08 -0400, Jason Merrill via Gcc wrote: Generally we want to use the GCC hash_map because it works with GCC garbage collection (and PCH). Is that not relevant to your patch? Jason The map is only part a short-lived visitor object inside the analyzer and is used t

Re: Debugging C++ frontend using CLion IDE

2023-03-01 Thread Tim Lange
Hi Berke, I had the same problem last year. Many IDEs don't really work for developing gcc. Most here probably use either emacs or vim. If you want to use an IDE, you might have to do some hacks. The oldschool indentation style of gcc (mix of tab and spaces) is not widely supported. IDEs/Edi