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

 
 

bug #40371: Make 4.0 is not 8 bit clean

Submitted by:  Robert Bogomip <bobbogo>
Submitted on:  Fri 25 Oct 2013 10:55:27 AM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 4.0Operating System: None
Fixed Release: 4.1Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

Fixed in Git; thanks for the report.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 27 Oct 2013 09:44:16 PM UTCpsmithStatusNone=>Fixed
      Assigned toNone=>psmith
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.1

    Back to the top


    Powered by Savane 3.1-cleanup1