bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #40371] Make 4.0 is not 8 bit clean


From: Robert Bogomip
Subject: [bug #40371] Make 4.0 is not 8 bit clean
Date: Fri, 25 Oct 2013 10:55:28 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0

URL:
  <http://savannah.gnu.org/bugs/?40371>

                 Summary: Make 4.0 is not 8 bit clean
                 Project: make
            Submitted by: bobbogo
            Submitted on: Fri 25 Oct 2013 10:55:27 AM GMT
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: 4.0
        Operating System: None
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

"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))






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?40371>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]