Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-12 Thread Florian Weimer via Gcc
* Pedro Alves: > For example, for the type above, we'd have: > > typedef std::unique_ptr pending_diagnostic_up; > > and then: > > -pending_diagnostic *d, > +pending_diagnostic_up d, > > I would suggest GCC have a similar guideline

Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-12 Thread Jonathan Wakely via Gcc
On Tue, 12 Jul 2022 at 11:22, Florian Weimer via Gcc wrote: > > * Pedro Alves: > > > For example, for the type above, we'd have: > > > > typedef std::unique_ptr pending_diagnostic_up; > > > > and then: > > > > -pending_diagnostic *d, > > +

Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-12 Thread Pedro Alves
On 2022-07-12 11:21 a.m., Florian Weimer wrote: > * Pedro Alves: > >> For example, for the type above, we'd have: >> >> typedef std::unique_ptr pending_diagnostic_up; >> >> and then: >> >> - pending_diagnostic *d, >> + pending_diagnos

Re: [RFC] Using std::unique_ptr and std::make_unique in our code

2022-07-12 Thread Pedro Alves
On 2022-07-12 11:45 a.m., Jonathan Wakely wrote: > On Tue, 12 Jul 2022 at 11:22, Florian Weimer via Gcc wrote: >> >> * Pedro Alves: >> >>> For example, for the type above, we'd have: >>> >>> typedef std::unique_ptr pending_diagnostic_up; >>> >>> and then: >>> >>> -

[PATCH] filedescriptor attribute

2022-07-12 Thread Immad Mir via Gcc
--- gcc/analyzer/sm-fd.cc| 231 --- gcc/c-family/c-attribs.cc| 63 gcc/testsuite/gcc.dg/analyzer/fd-5.c | 44 + gcc/testsuite/gcc.dg/analyzer/fd-6.c | 4 + 4 files changed, 322 insertions(+), 20 deletions(-) create mode 100644 g

Re: [PATCH] filedescriptor attribute

2022-07-12 Thread Mir Immad via Gcc
Hi everyone, This is an in-progress patch for adding three new function attributes to GCC for static analysis of file descriptor APIs (which is a part of my GSoC project) 1) __attribute__((accesses_fd(N))) This attribute expected argument N of a function to be an open file descriptor. (see test_

Adding file descriptor attribute(s) to gcc and glibc

2022-07-12 Thread David Malcolm via Gcc
On Tue, 2022-07-12 at 23:03 +0530, Mir Immad wrote: [cross-posting to the glibc development mailing list; updating subject accordingly] > Hi everyone, Hi Immad, GCC developers, and glibc developers. glibc developers: Immad is a GSoC student, he's been adding checks for file-descriptor-based API

Re: Adding file descriptor attribute(s) to gcc and glibc

2022-07-12 Thread David Malcolm via Gcc
On Tue, 2022-07-12 at 18:16 -0400, David Malcolm wrote: > On Tue, 2022-07-12 at 23:03 +0530, Mir Immad wrote: > > [cross-posting to the glibc development mailing list; updating subject > accordingly] > > > Hi everyone, > > Hi Immad, GCC developers, and glibc developers. > > glibc developers: Im