Re: [PATCH] Make -Wuse-after-free=3 the default one in -Wall

2023-02-17 Thread Siddhesh Poyarekar
On 2023-02-17 17:58, Alejandro Colomar wrote: On 2/17/23 22:41, Siddhesh Poyarekar wrote: On 2023-02-17 16:39, Siddhesh Poyarekar wrote: You've got the customs right as far as submission is concerned; gcc Oh, one correction: patches typically go to gcc-patches at gcc dot gnu dot org. Okay,

Re: [PATCH] Make -Wuse-after-free=3 the default one in -Wall

2023-02-17 Thread Alejandro Colomar via Gcc
Hi Siddhesh, On 2/17/23 22:39, Siddhesh Poyarekar wrote: > On 2023-02-17 16:20, Alejandro Colomar wrote: >> Link: >> >> Link: >> >> Cc: A

gcc-11-20230217 is now available

2023-02-17 Thread GCC Administrator via Gcc
Snapshot gcc-11-20230217 is now available on https://gcc.gnu.org/pub/gcc/snapshots/11-20230217/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 11 git branch with the following options: git://gcc.gnu.org/git/gcc.git branch

Re: [PATCH] Make -Wuse-after-free=3 the default one in -Wall

2023-02-17 Thread Siddhesh Poyarekar
On 2023-02-17 16:39, Siddhesh Poyarekar wrote: You've got the customs right as far as submission is concerned; gcc Oh, one correction: patches typically go to gcc-patches at gcc dot gnu dot org. Thanks, Sid

Re: [PATCH] Make -Wuse-after-free=3 the default one in -Wall

2023-02-17 Thread Siddhesh Poyarekar
On 2023-02-17 16:20, Alejandro Colomar wrote: Link: Link: Cc: Andreas Schwab Cc: David Malcolm Cc: Florian Weimer Cc: Iker Pedrosa Cc

[PATCH] Make -Wuse-after-free=3 the default one in -Wall

2023-02-17 Thread Alejandro Colomar via Gcc
Link: Link: Cc: Andreas Schwab Cc: David Malcolm Cc: Florian Weimer Cc: Iker Pedrosa Cc: Jens Gustedt Cc: Jonathan Wakely Cc: Mark Wi

Re: Stepping down as gcov maintainer and callgraph reviewer

2023-02-17 Thread Jeff Law via Gcc
On 2/17/23 09:18, Aldy Hernandez via Gcc wrote: Woah. Sad to see you leave! Definitely a sad day, both for the project and for me personally. It's always been a pleasure to work with you. Thanks for all the great work, and good luck on your next endeavors. Likewise. And if you want to c

Re: get_range_query vs NULL argument

2023-02-17 Thread Andrew Pinski via Gcc
On Wed, Feb 15, 2023 at 2:30 PM Andrew MacLeod wrote: > > > On 2/15/23 14:50, Andrew Pinski wrote: > > Hi, > >While fixing PR 108354, I came across that > > ssa_name_has_boolean_range calls get_range_query with cfun as the > > argument but sometimes while in IPA passes cfun is currently nullpt

Re: Stepping down as gcov maintainer and callgraph reviewer

2023-02-17 Thread Aldy Hernandez via Gcc
Woah. Sad to see you leave! It's always been a pleasure to work with you. Thanks for all the great work, and good luck on your next endeavors. Aldy On Thu, Feb 16, 2023 at 4:55 PM Martin Liška wrote: > > Hello GCC community. > > After spending last decade (including my diploma thesis even mor

Re: Failure During Building

2023-02-17 Thread Iain Sandoe
> On 17 Feb 2023, at 15:37, Jonathan Wakely via Gcc wrote: > > On Fri, 17 Feb 2023, 15:17 -xlan- via Gcc, wrote: > >> I was building gcc version 4.9.1 > > > Why? Indeed, what is the use-case? trying to build such an old GCC version on modern macOS could be problematic. > on Mac OS versio

Aw: Re: Warning: shared mutable data

2023-02-17 Thread Helmut Zeisel via Gcc
Von: "Jonathan Wakely"  > What exactly are you suggesting for the semantics of the warning? Good question. It is difficult to detect all suspiscious cases, but at least some of the can be defined: If we have a function prototype f(...,Ti xi,...Tj xj,...) and call the function f(... xi, ..

Re: Failure During Building

2023-02-17 Thread Jonathan Wakely via Gcc
On Fri, 17 Feb 2023, 15:17 -xlan- via Gcc, wrote: > I was building gcc version 4.9.1 Why? on Mac OS version when I got this error: > > In file included from ../../gcc-4.9.1/gcc/c/c-objc-common.c:33: > In file included from > > /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c+

Failure During Building

2023-02-17 Thread -xlan- via Gcc
I was building gcc version 4.9.1 on Mac OS version when I got this error: In file included from ../../gcc-4.9.1/gcc/c/c-objc-common.c:33: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:93: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/inc

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Jonathan Wakely via Gcc
On Fri, 17 Feb 2023, 12:53 Siddhesh Poyarekar, wrote: > On 2023-02-17 06:24, Jonathan Wakely wrote: > > Please be aware that in C++ it's implementation-defined, not undefined. > > > > That means that an implementation without trap representations for > > pointers can choose to make it behave just

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Siddhesh Poyarekar
On 2023-02-17 09:01, Mark Wielaard wrote: The reason people might not know about it, is that the documentation is somewhat unclear. -Wall says it already includes -Wuse-after-free=3: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wall Yeah I posted a patch to fix it only a few mi

Re: Warning: shared mutable data

2023-02-17 Thread Jonathan Wakely via Gcc
On Fri, 17 Feb 2023, 13:15 Helmut Zeisel via Gcc, wrote: > Recently I read about Value-Oriented Programming > ( https://accu.org/journals/overload/31/173/teodorescu/ ) > There it is pointed out that sharing mutable data. i. e., code like > > my_push_back(vec, vec[0]); > > can lead to subtle error

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Mark Wielaard
On Fri, 2023-02-17 at 08:38 -0500, Siddhesh Poyarekar wrote: > On 2023-02-17 06:22, Alejandro Colomar wrote: > > Hi Siddhesh, > > > > On 2/17/23 04:48, Siddhesh Poyarekar wrote: > > > On 2023-02-16 10:15, David Malcolm via Gcc wrote: > > > > I'm not convinced that it's useful to the end-user to wa

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Siddhesh Poyarekar
On 2023-02-17 08:44, David Malcolm wrote: This is possibly a silly question, but what *are* these safe alternatives? [1] How does one test to see if an object has been reallocated? Oops sorry, I snipped off that part when pasting from the man page. Typically such conditionals are used to updat

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Martin Uecker via Gcc
Am Freitag, dem 17.02.2023 um 12:35 +0100 schrieb Alejandro Colomar: > Hi Martin, > > On 2/17/23 09:12, Martin Uecker wrote: > > Am Freitag, dem 17.02.2023 um 02:04 +0100 schrieb Alejandro Colomar > > > > > > > > > > [...] > > > > > > > > > > > I'm not convinced that it's useful to the end-us

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread David Malcolm via Gcc
On Thu, 2023-02-16 at 22:48 -0500, Siddhesh Poyarekar wrote: > On 2023-02-16 10:15, David Malcolm via Gcc wrote: > > I'm not convinced that it's useful to the end-user to warn about > > the > > "use of q itself" case. > > FWIW, -Wuse-after-free=3 already should do this: > > At level 3, the warnin

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Siddhesh Poyarekar
On 2023-02-17 06:22, Alejandro Colomar wrote: Hi Siddhesh, On 2/17/23 04:48, Siddhesh Poyarekar wrote: On 2023-02-16 10:15, David Malcolm via Gcc wrote: I'm not convinced that it's useful to the end-user to warn about the "use of q itself" case. FWIW, -Wuse-after-free=3 already should do thi

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Andreas Schwab
On Feb 17 2023, Alejandro Colomar via Gcc wrote: > C2x (N3054 is the latest I know): > > If a pointer value is used in an evaluation after > the object the pointer points to (or just past) > reaches the end of its lifetime, > the behavior is undefined. >

Warning: shared mutable data

2023-02-17 Thread Helmut Zeisel via Gcc
Recently I read about Value-Oriented Programming ( https://accu.org/journals/overload/31/173/teodorescu/ ) There it is pointed out that sharing mutable data. i. e., code like my_push_back(vec, vec[0]); can lead to subtle errors. Of course GCC cannot change C++ to a language like Val that forbids

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Siddhesh Poyarekar
On 2023-02-17 06:24, Jonathan Wakely wrote: Please be aware that in C++ it's implementation-defined, not undefined. That means that an implementation without trap representations for pointers can choose to make it behave just like using (uintptr_t)p. https://cplusplus.github.io/CWG/issues/143

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Jonathan Wakely via Gcc
On Fri, 17 Feb 2023, 11:43 Alejandro Colomar, wrote: > Hi Jonathan, > > On 2/17/23 12:24, Jonathan Wakely wrote: > > Please be aware that in C++ it's implementation-defined, not undefined. > > > > That means that an implementation without trap representations for > pointers > > can choose to make

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Alejandro Colomar via Gcc
Hi Jonathan, On 2/17/23 12:24, Jonathan Wakely wrote: > Please be aware that in C++ it's implementation-defined, not undefined. > > That means that an implementation without trap representations for pointers > can choose to make it behave just like using (uintptr_t)p. (uintptr_t)p is defined (I

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Alejandro Colomar via Gcc
Hi Martin, On 2/17/23 09:12, Martin Uecker wrote: > Am Freitag, dem 17.02.2023 um 02:04 +0100 schrieb Alejandro Colomar > > >> >> [...] >> >>> >>> I'm not convinced that it's useful to the end-user to warn about >>> the >>> "use of q itself" case. >> >> I didn't quote the standard because I coul

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Jonathan Wakely via Gcc
On Fri, 17 Feb 2023, 03:49 Siddhesh Poyarekar, wrote: > On 2023-02-16 10:15, David Malcolm via Gcc wrote: > > I'm not convinced that it's useful to the end-user to warn about the > > "use of q itself" case. > > FWIW, -Wuse-after-free=3 already should do this: > > At level 3, the warning also diag

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Alejandro Colomar via Gcc
Hi Siddhesh, On 2/17/23 04:48, Siddhesh Poyarekar wrote: > On 2023-02-16 10:15, David Malcolm via Gcc wrote: >> I'm not convinced that it's useful to the end-user to warn about the >> "use of q itself" case. > > FWIW, -Wuse-after-free=3 already should do this: Thanks! It works. I would have ex

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Yann Droneaud
Hi, Le 16/02/2023 à 15:35, Alejandro Colomar via Gcc a écrit : Hi! I was preparing an example program of a use-after-realloc bug, when I found that GCC doesn't warn in a case where it should. alx@debian:~/tmp$ cat realloc.c #include #include #include #include #include static inline char

Re: Missed warning (-Wuse-after-free)

2023-02-17 Thread Martin Uecker via Gcc
Am Freitag, dem 17.02.2023 um 02:04 +0100 schrieb Alejandro Colomar > > [...] > > > > > I'm not convinced that it's useful to the end-user to warn about > > the > > "use of q itself" case. > > I didn't quote the standard because I couldn't find it.  I was > searching in C11, > and it seems th