Fri 25 Oct 2013 10:55:27 AM UTC, original submission:
"Gnah!" as the Germans say (apparently).
I have a bunch of Makefiles that use 8-bit characters, some latin1 encoded, and some utf-8 encoded. Make 4.0 is unable to parse them due (at least) to an array-out-of-bounds bug.
I don't know how these characters will look in bugzilla, but please bear with me:
$ cat Makefile
▪ := hello
$(error [${▪}])
So this snippet is setting the variable who's name is ▪ (unicode square bullet, "Ctrl+K s B" in vim, 0xe2 0x96 0xaa in utf-8.
On cygwin, make 4.0 fails to parse the first line as an assignment and you get a "*** missing separator. Stop." message (sorry don't have a windows machine right now). YMMV on other platforms, as the parser is reading from outside the stopchar_map[] array, and it depends on the pattern that happens to be there.
Fix
===
the problem is that a signed character is passed in as _v to this expression:
#define STOP_SET(_v,_m) ANY_SET (stopchar_map[(int)(_v)],(_m))
in makeint.h. stopchar_map[] is a 256 entry lookup table. You at least need
#define STOP_SET(_v,_m) ANY_SET (stopchar_map[0xff & (unsigned int)(_v)],(_m))
|