[PATCH] output.c: Fix memory stomp when need==fmtbuf.size

2014-01-26 Thread Ray Donnelly
Hi,

Git commit 757849cd introduced a memory stomp in get_buffer() in
output.c. If need is is equal to fmtbuf.size then:
fmtbuf.buffer[need] = '\0';
.. writes '\0' to a byte 1 beyond the size of the allocated buffer.

Please find attached a patch which fixes this.

Best regards,

Ray Donnelly.


0001-output.c-Fix-memory-stomp-when-need-fmtbuf.size.patch
Description: Binary data
___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: win32 compilation of make 4.0 source code‏

2014-01-26 Thread Mark Brown

That example method is a device to perform this .FEATURES test
without inserting it into an existing Makefile.
The syntax errors I was seeing were occurring when attempting to insert this 
test

into an existing Makefile, full of Targets and command sequences.
If this feature is used it would be at the top of an existing Makefile, 
before any targets

are evaluated.

I also want to know if there is a debug mode within make
in which the Makefile filename and Line Number
(some Makefiles are huge and distributed over several subordinate Makefiles)
is matched to each automatic variable evaluation within a Target evaluation.

-Original Message- 
From: Paul Smith

Sent: Friday, January 24, 2014 11:28 AM
To: Mark Brown
Cc: Eli Zaretskii ; Pavel Fedin ; bug-make@gnu.org
Subject: Re: win32 compilation of make 4.0 source code‏

On Fri, 2014-01-24 at 11:03 -0800, Mark Brown wrote:

I had a  make.exe 3.80 and it had problems with else ifeq
constructs, so that forced me to seek a more recent version for win32.


Yes that version didn't support it.  You can look at the latest NEWS
file for info on what appeared when:

http://git.savannah.gnu.org/cgit/make.git/tree/NEWS



As a separate related issue, I was try to echo the .FEATURES
information, since one of the its it claims to display mentions its
Else If capabilities. However, every time I tried to echo the data I
received a syntax error. What would be an example of a Makefile
contents which would display the .FEATURES information ?


There are a number of ways.  Here's one that works with newer versions
of GNU make (this is POSIX shell syntax):

 echo 'all: ; @echo FEATURES is $(.FEATURES)' | make -f-



___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make