Skip to content

Commit

Permalink
[ragel] Switch to -T1 output instead of -F1
Browse files Browse the repository at this point in the history
Fedora upgraded to ragel 7, which is buggy if char is signed.
Switching to -G2 output fails with sign-compare error:

../../src/hb-buffer-deserialize-json.hh:107:12: error: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘const char’ [-Werror=sign-compare]
    if ( 9u <= ( (*( p))) && ( (*( p))) <= 13u ) {
         ~~~^~~~~~~~~~~~~

Switching to -T1 for now.  It actually results in smaller code,
at the expense of some binary searching instead of flat tables.
In the not distant future, we might actually generate two different
outputs and choose between depending on size-optimize options.

Fixes #1708
  • Loading branch information
behdad committed May 13, 2019
1 parent df3f36f commit ae8719e
Show file tree
Hide file tree
Showing 7 changed files with 4,646 additions and 1,595 deletions.
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ EXTRA_DIST += \
# We decided to add ragel-generated files to git...
#MAINTAINERCLEANFILES += $(RAGEL_GENERATED)
$(srcdir)/%.hh: $(srcdir)/%.rl
$(AM_V_GEN)(cd $(srcdir) && $(RAGEL) -e -F1 -o "$*.hh" "$*.rl") \
$(AM_V_GEN)(cd $(srcdir) && $(RAGEL) -e -T1 -o "$*.hh" "$*.rl") \
|| ($(RM) "$@"; false)

noinst_PROGRAMS = \
Expand Down
Loading

0 comments on commit ae8719e

Please sign in to comment.