bugmake - Bugs: bug #40371, Make 4.0 is not 8 bit clean

 
 

bug #40371: Make 4.0 is not 8 bit clean

Submitter:  Robert Bogomip <bobbogo>
Submitted:  Fri 25 Oct 2013 10:55:27 AM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  4.0 Operating System:  None
Fixed Release:  4.1 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 27 Oct 2013 09:44:16 PM UTC, comment #1: 

Fixed in Git; thanks for the report.

Paul D. Smith <psmith>
Group administrator
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))


Robert Bogomip <bobbogo>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by bobbogo (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-27 psmith StatusNone Fixed
        Assigned toNone psmith
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.1

    Back to the top

    Powered by Savane 3.13-ec04.
    Corresponding source code