[tex-k] Re: [NTG-pdftex] pdftex snapshot

Taco Hoekwater taco at elvenkind.com
Tue May 24 11:40:04 CEST 2005


Hi Thanh / TeX-k people,

There are some compile-time warnings in the latest snapshots
of pdftex, that are very simple to fix.


In pdftex.ch: the macro pdf_room() first checks its argument against
the pdf_buf_size, but pdf_buf_size is larger (16384) than the largest
possible value for the type of k (a C char), so there are always two
compile-time warnings from gcc:

   pdfetex0.c: In function `zpdfprintint':
   pdfetex0.c:2696: warning: comparison is always false due to limited
   range of data type
   pdfetex1.c: In function `zpdfprintfwint':
   pdfetex1.c:8673: warning: comparison is always false due to limited
   range of data type

Here is a small (two lines) change that surpresses these
compile-time warnings in pdftex0.c and pdftex1.c:
--------------------------------------------------------
diff pdftex.ch.orig  pdftex.ch
1215c1215
< var k:0..23; {index to current digit; we assume that $|n|<10^{23}$}
---
 > var k:integer; {index to current digit; we assume that $|n|<10^{23}$}
2015c2015
< var k:0..23;
---
 > var k:integer;
-------------------------------------------------------------

In pdftex.ch, there is a similar message in tex.ch:load_fmt_file():
items in hyf_next[1] cannot be larger than max_trie_op (65535):

   pdfetexini.c: In function `loadfmtfile':
   pdfetexini.c:4194: warning: comparison is always false due to limited
   range of data type

Here is a different one-line patch to fix that as well:
--------------------------------------------------------------
diff tex.ch.orig tex.ch
227c227
< @!max_trie_op=ssup_trie_opcode; {largest possible trie opcode for any 
language}
---
 > @!max_trie_op=ssup_trie_opcode-1; {largest possible trie opcode for 
any language}
--------------------------------------------------------------

Greetings, Taco



More information about the tex-k mailing list