This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix a signed/unsigned warning
[perl5.git] / regcomp.pl
index 97403ba..febd550 100644 (file)
@@ -16,6 +16,8 @@ while (<DESC>) {
 }
 close DESC;
 $tot = $ind;
+die "Too many regexp opcodes! Maximum is 256, but there are $tot in file!"
+    if $tot>256;
 
 $tmp_h = 'tmp_reg.h';
 
@@ -25,7 +27,8 @@ open OUT, ">$tmp_h";
 binmode OUT;
 
 print OUT <<EOP;
-/* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
+/* -*- buffer-read-only: t -*-
+   !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
    This file is built by regcomp.pl from regcomp.sym.
    Any changes made here will be lost!
 */
@@ -42,6 +45,7 @@ EOP
 }
 
 print OUT <<EOP;
+#define REGNODE_MAX $oind
 
 #ifndef DOINIT
 EXTCONST U8 PL_regkind[];
@@ -115,6 +119,7 @@ static const int reg_num = $tot;
 #endif /* DEBUGGING */
 #endif /* REG_COMP_C */
 
+/* ex: set ro: */
 EOP
 
 close OUT or die "close $tmp_h: $!";