[OS X TeX] Can some one help me compile this: "Check LaTeX Begin-End Pairs"?

Jeffrey Goldberg jeffrey at goldmark.org
Sun Apr 4 00:59:52 CEST 2010


On Apr 3, 2010, at 4:59 PM, Peter Dyballa wrote:

> Am 03.04.2010 um 22:59 schrieb Ramón Figueroa-Centeno:
> 
>> i have not been able to compile it
> 	lex chktex.l
> 
> produces the lex.yy.c C source file. Since the lex code is two decades old the C source needs an update on line #62:
> 
> 	change the "char *" type of malloc to "void *"

I had just commented out that declaration.  Modern (f)lex output will have an "#include <stdlib.h>" in the C output.


But there's another fix needed on around line 85

 *** 82,88 ****
  		      StackName [StackInd] = malloc (yyleng + 1);
  		      if (StackName [StackInd] == NULL)
  		        {
! 		          printf ("Line %d : memory allocation failed\n");
  		          return 1;
  		        }
  		      strcpy (StackName [StackInd], yytext);
--- 82,89 ----
  		      StackName [StackInd] = malloc (yyleng + 1);
  		      if (StackName [StackInd] == NULL)
  		        {
! 		          printf ("Line %d : memory allocation failed\n",
! 			     Line);
  		          return 1;
  		        }
  		      strcpy (StackName [StackInd], yytext);



> Test, best with:
> 
> 	env PATH=.:$PATH checktex <test file.tex>
> 
> because the shell script checktex looks for chktex in $PATH. And nowadays $PATH does not contain ``.´´. Or:
> 
> 	./chktex < checktex.tst

The thing really needs a main() wrapper that does argument handling instead of that shell script to handle arguments.

Cheers,

-j


-- 
Jeffrey Goldberg                        http://www.goldmark.org/jeff/




More information about the macostex-archives mailing list