ef9b998
From 7ce68c4bca7fd64c0073f1770c6b5761c03174f0 Mon Sep 17 00:00:00 2001
ef9b998
From: Sergei Trofimovich <slyfox@gentoo.org>
ef9b998
Date: Wed, 21 Mar 2018 21:30:31 +0000
ef9b998
Subject: [PATCH] ht: fix build failure on -funsigned-char platforms
ef9b998
ef9b998
powerpc (and arm) have 'char' == 'unsigned char' by default.
ef9b998
This causes build failures on c++11:
ef9b998
ef9b998
```
ef9b998
$ ./configure CFLAGS=-funsigned-char CXXFLAGS=-funsigned-char
ef9b998
$ make
ef9b998
ef9b998
g++ -DHAVE_CONFIG_H -I.   -I./analyser -I./asm -I./info -I./io/posix -I./io -I./output -I./eval -I.   -DNOMACROS -pipe -O3 -fomit-frame-pointer -Wall -fsigned-char -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c++14 -Woverloaded-virtual -Wnon-virtual-dtor -funsigned-char -MT htcoffhd.o -MD -MP -MF .deps/htcoffhd.Tpo -c -o htcoffhd.o htcoffhd.cc
ef9b998
htcoffhd.cc:93:1: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]
ef9b998
 };
ef9b998
 ^
ef9b998
htcoffhd.cc:131:1: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]
ef9b998
 };
ef9b998
```
ef9b998
ef9b998
Use 'signed char' explicitly to maintain existing behavior.
ef9b998
ef9b998
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
ef9b998
---
ef9b998
 httag.h | 2 +-
ef9b998
 1 file changed, 1 insertion(+), 1 deletion(-)
ef9b998
ef9b998
diff --git a/httag.h b/httag.h
ef9b998
index 7f5da1c..83e5c22 100644
ef9b998
--- a/httag.h
ef9b998
+++ b/httag.h
ef9b998
@@ -69,7 +69,7 @@ struct ht_tag_flags {
ef9b998
 } PACKED;
ef9b998
 
ef9b998
 struct ht_tag_flags_s {
ef9b998
-	char bitidx;
ef9b998
+	signed char bitidx;
ef9b998
 	const char *desc;
ef9b998
 } PACKED;
ef9b998