Issue 50053 - dmake 4.4 fails to read recipe to its end
Summary: dmake 4.4 fails to read recipe to its end
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: dmake (show other issues)
Version: current
Hardware: All All
: P2 Trivial (vote)
Target Milestone: ---
Assignee: hjs
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-30 16:51 UTC by quetschke
Modified: 2013-08-07 15:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch to correctly parse empty lines (819 bytes, patch)
2005-05-30 19:25 UTC, quetschke
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description quetschke 2005-05-30 16:51:29 UTC
Found with cws dmake43p01 when building moz:

=============
Building project moz
=============
/cygdrive/d/w1/SRC680_m106/moz
mkout -- version: 1.4
dmake:  extractfiles.mk:  line 233:  Error: -- Expecting macro or rule defn,
found neither
Comment 1 quetschke 2005-05-30 18:11:17 UTC
This makefile triggers the problem:

--- snip ---
.NOTABS	  !:= yes

aaa :

	echo bbb
--- snap ---

Just do:
$ dmake/dmake -r -f mymakefile.mk

And if you replace the <tab> in front of "echo bbb" with some spaces it also
triggers without the ".NOTABS !:= yes".
Comment 2 quetschke 2005-05-30 19:25:32 UTC
Created attachment 26721 [details]
Patch to correctly parse empty lines
Comment 3 quetschke 2005-05-30 19:42:47 UTC
Committed to cws dmake43p01
Comment 4 quetschke 2005-05-30 19:43:25 UTC
Please verify.
Comment 5 quetschke 2005-05-31 23:14:02 UTC
I managed to miss an important negation.

-              if( *Buffer || *DmStrSpn( Buffer, " \t\r\n" ) == '\0' ) break;
+              if( !*Buffer || *DmStrSpn( Buffer, " \t\r\n" ) == '\0' ) break;

This way it silently discarded everything after an empty line. Surprisingly
enough OOo build to the end with this bug!

Fixed in cws.
Comment 6 quetschke 2005-06-01 03:35:03 UTC
And another one.

+++ dmake/parse.c       1 Jun 2005 02:10:27 -0000
@@ -107,8 +107,9 @@
                   }
                   else if( *p == ']' )
                      Fatal( "Found unmatched ']'" );
-                  else if( (*pTmpBuf && *p) || (Notabs && !*pTmpBuf && !*p))
+                  else if( *pTmpBuf ) /* Something that was no recipe. */
                     State = NORMAL_SCAN;
+                 /* The only thing that was not handled was an empty line. */
                }
  
                if( State == RULE_SCAN ) break;     /* ie. keep going    */

*pTmpBuf was never "" for the old dmake, therefore the Notabs == true case
never triggered before. This check was completely bogus.

Committed to the cws. The simple makefile now works as expected.
Comment 7 hjs 2006-04-19 15:11:23 UTC
.
Comment 8 hjs 2006-04-21 17:32:57 UTC
.