Re: [bug #60798] Make does not compile with GCC 11.1.0

2021-06-19 Thread Paul Smith
On Sat, 2021-06-19 at 16:23 +0100, Dmitrii Pasechnik wrote: > > I don't think I understand. > > p[] occupies a continuous memory area, starting from p[0], but p[-1] > is not guaranteed by the standard to be accessible for you (well, > unless you control the memory layout by placing p in a struct,

Re: [bug #60798] Make does not compile with GCC 11.1.0

2021-06-19 Thread Eli Zaretskii
> Date: Sat, 19 Jun 2021 16:40:08 +0100 > From: Dmitrii Pasechnik > Cc: bo...@kolpackov.net, bug-make > > Compiler does not guarantee you that doing something with p[-1] > is not going to end in a segfault. It's hack, as it just happens to work, but > YMMV. > > E.g. clang 10, or Apple's clang

Re: [bug #60798] Make does not compile with GCC 11.1.0

2021-06-19 Thread Dmitrii Pasechnik
On Sat, Jun 19, 2021 at 11:10:14AM -0400, Dmitry Goncharov wrote: > On Sat, Jun 19, 2021 at 10:31 AM Dmitrii Pasechnik > wrote: > > It's undefined behaviour in C to point to such a location, isn't it? > > Is this hack really needed? > > There is no hack. It is pointer arithmetic in c. p[-1] is

Re: [bug #60798] Make does not compile with GCC 11.1.0

2021-06-19 Thread Dmitrii Pasechnik
On Sat, Jun 19, 2021 at 10:52:41AM -0400, Paul Smith wrote: > On Sat, 2021-06-19 at 15:31 +0100, Dmitrii Pasechnik wrote: > > On Fri, Jun 18, 2021 at 12:53:32PM -0400, Paul D. Smith wrote: > > > > > Follow-up Comment #1, bug #60798 (project make): > > > FWIW, this warning is not valid in this

Re: [bug #60798] Make does not compile with GCC 11.1.0

2021-06-19 Thread Dmitry Goncharov via Bug reports and discussion for GNU make
On Sat, Jun 19, 2021 at 10:31 AM Dmitrii Pasechnik wrote: > It's undefined behaviour in C to point to such a location, isn't it? > Is this hack really needed? There is no hack. It is pointer arithmetic in c. p[-1] is the same as *(p-1). regards, Dmitry

[bug #60799] Parser chokes on second expansion of a prerequisite with ; o #

2021-06-19 Thread Dmitry Goncharov
Follow-up Comment #3, bug #60799 (project make): Yes, it is possible to store special characters in a variable. i'd not bother fixing this, if not for the fact that make already supports this input. It is just when second expansion is enabled the parser fails. i don't think this inconsistency

Re: [bug #60798] Make does not compile with GCC 11.1.0

2021-06-19 Thread Eli Zaretskii
> From: Paul Smith > Date: Sat, 19 Jun 2021 10:52:41 -0400 > Cc: bug-make@gnu.org > > On Sat, 2021-06-19 at 15:31 +0100, Dmitrii Pasechnik wrote: > > On Fri, Jun 18, 2021 at 12:53:32PM -0400, Paul D. Smith wrote: > > > > > Follow-up Comment #1, bug #60798 (project make): > > > FWIW, this

Re: [bug #60798] Make does not compile with GCC 11.1.0

2021-06-19 Thread Paul Smith
On Sat, 2021-06-19 at 15:31 +0100, Dmitrii Pasechnik wrote: > On Fri, Jun 18, 2021 at 12:53:32PM -0400, Paul D. Smith wrote: > > > Follow-up Comment #1, bug #60798 (project make): > > FWIW, this warning is not valid in this situation. The code is > > correct; p will always be pointing into a

Re: [bug #60798] Make does not compile with GCC 11.1.0

2021-06-19 Thread Dmitrii Pasechnik
On Fri, Jun 18, 2021 at 12:53:32PM -0400, Paul D. Smith wrote: > Follow-up Comment #1, bug #60798 (project make): > > FWIW, this warning is not valid in this situation. The code is correct; p > will always be pointing into a valid buffer and never pointing at the first > character in that

[bug #60799] Parser chokes on second expansion of a prerequisite with ; o #

2021-06-19 Thread Paul D. Smith
Follow-up Comment #2, bug #60799 (project make): I will look at the fix but I'm not sure I want to try to work around this. If "$$" appears in the prerequisite list then it's not special to make... this is true regardless of whether second expansion is enabled or not. As with all special

[bug #60799] Parser chokes on second expansion of a prerequisite with ; o #

2021-06-19 Thread Dmitry Goncharov
Follow-up Comment #1, bug #60799 (project make): [comment #0 original submission:] > Parser chokes on second expansion of a prerequisite with ; o # > > $ cat makefile > MAKEFLAGS+=--warn-undefined-variables > .SECONDEXPANSION: > hello: $$(shell echo world;) > touch $@ > > bye:

[bug #60799] Parser chokes on second expansion of a prerequisite with ; o #

2021-06-19 Thread Dmitry Goncharov
URL: Summary: Parser chokes on second expansion of a prerequisite with ; o # Project: make Submitted by: dgoncharov Submitted on: Sat 19 Jun 2021 01:41:58 PM UTC Severity: 3 - Normal