bugmake - Bugs: bug #14818, should warn about spaces vs. tabs...

 
 

bug #14818: should warn about spaces vs. tabs in makefiles for cases other than 8 spaces

Submitted by:  None
Submitted on:  Tue 18 Oct 2005 11:49:04 PM UTC  
 
Severity: 3 - NormalItem Group: None
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.80Operating System: POSIX-Based
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 19 Oct 2005 12:15:02 AM UTC, comment #1:

There's no way for make to know whether a line should or shouldn't have a TAB at the beginning. If it could know that, then it wouldn't need to have a TAB there in the first place. The TAB is the thing (and the ONLY thing) that tells make whether the line is a command script or not.

Similarly, there is no error in having whitespace before a target, so there's no way make can tell the difference between a target and a command line where someone forgot the TAB and that happens to have a colon in it.

In older versions of GNU make, even 8 spaces wasn't handled specially. Enough people were burned by cutting/pasting, etc. errors that the special check for 8 spaces was added. But, this is just a hint, if make would have failed anyway. Ultimately there's no way make can tell whether there should have been a TAB there, or if it was some other error.

Paul D. Smith <psmith>
Project Administrator
Tue 18 Oct 2005 11:49:04 PM UTC, original submission:

Make should issue some sort of error or warning when a Makefile has spaces at the beginning of a line instead of a tab if this is a requirement for the command to execute. Version 3.80 seems to check for the case of 8 spaces, but many editors may also put 4 spaces instead of a tab.

Additionally, it appears that no warning is given for spaces at the beginning of a line which is deemed to be a "target" line due to having a colon in the line. Unfortunately, if you use the chown command the recommended delimiter between user and group names is the colon character.

I'm attaching an example Makefile which illustrates the problem. The 8 spaces could be changed to 3 or 4 spaces to try out an improved warning about initial spaces.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #2834:  Makefile added by None (85B - application/octet-stream - example Makefile which incorrectly uses spaces instead of a tab)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 19 Oct 2005 12:15:02 AM UTCpsmithStatusNone=>Not A Bug
  Open/ClosedOpen=>Closed
Tue 18 Oct 2005 11:49:04 PM UTCNoneAttached File-=>Added Makefile, #3047

Back to the top


Powered by Savane 3.1-cleanup1