Date: Sat, 12 Aug 2000 19:29:00 +0200 To: bkorb AT gnu DOT org Message-Id: <2110-Sat12Aug2000192900+0000-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b From: "Eli Zaretskii" CC: djgpp-workers AT delorie DOT com In-reply-to: <399031D7.6FF8F2E1@sco.com> (message from Bruce Korb on Tue, 08 Aug 2000 09:14:15 -0700) Subject: Re: DJGPP patch for fixincludes References: <399031D7 DOT 6FF8F2E1 AT sco DOT com> Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Tue, 08 Aug 2000 09:14:15 -0700 > From: Bruce Korb > > > The diffs against fixinc/tests/base/testing.h are below. Do you think > > I should debug this? > > The blank lines are an interesting nuisance. This, and the extra NULL define are my own kockpit errors: I edited the input testing.h, and inadvertently left out the two lines and added one more "#define NULL". When I reverted testing.h to the version you sent me, these two diffs disappeared. > The 'strncmp()' thingey is a problem with the sed expression > in the sysv68_string fix: > > /* > * This sed expression is broken inside fixincl. > * The same expression seems to work outside, however :-( > */ > sed = "/^\tstrncmp(),$/N"; > sed = 's/^\(' "\t" 'strncmp()\),\n\(' "\t" 'strlen(),\)$/' > '\1;' "\\\nextern unsigned int\\\n\\2/"; > > If you can fix that one, it would be wonderful :-). Mission accomplished :-). The problem was caused by the interaction of this Sed expression and the one which follows it: sed = "/^extern int$/N"; sed = "s/^extern int\\(\\n\tstrlen(),\\)/extern size_t\\1/"; When this second expression saw "extern int", it would always cause Sed to read another line. Thus, "^\tstrncmp" would never be seen by Sed, since the previous line says "extern int". The same happens from the command line if you submit both expressions to Sed. The following patch should fix the problem. I didn't have the required tools installed to generate fixincl.x, so I patched fixincl.x manually; that worked for me (the fixed testing.h was identical to tests/base/testing.h). I hope that the inclhack.def patch below is correct. 2000-08-12 Eli Zaretskii * fixinc/inclhack.def (sysv68_string): Fix the Sed script so it works inside fixincl. --- fixinc/inclhack.d~0 Thu Jul 27 16:28:58 2000 +++ fixinc/inclhack.def Sat Aug 12 19:11:42 2000 @@ -2558,17 +2558,13 @@ sed = "/^extern char$/N"; sed = "s/^extern char\\(\\n\t\\*memccpy(),\\)$/extern void\\1/"; - /* - * This sed expression is broken inside fixincl. - * The same expression seems to work outside, however :-( - */ - sed = "/^\tstrncmp(),$/N"; - sed = 's/^\(' "\t" 'strncmp()\),\n\(' "\t" 'strlen(),\)$/' - '\1;' "\\\nextern unsigned int\\\n\\2/"; - sed = "/^extern int$/N"; sed = "s/^extern int\\(\\n\tstrlen(),\\)/extern size_t\\1/"; + sed = "/^extern int\\n\tstrncmp(),$/N"; + sed = 's/^\(' "extern int\\n\t" 'strncmp()\),\n\(' "\t" 'strlen(),\)$/' + '\1;' "\\\nextern unsigned int\\\n\\2/"; + test_text = "extern int strlen();\n"