tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ctype(3), again



Hi!

When compiling some software (like finance/gnucash) with clang 7.0.0
(but not with gcc!) on NetBSD-8.99.30/amd64, compilation fails with:

(this one's from www/tidy because I don't have the gnucash error handy):

array subscript is of type 'char' [-Wchar-subscripts]
...
/usr/include/sys/ctype_inline.h:59:46: note: expanded from macro 'tolower'
#define tolower(c)      ((int)((_tolower_tab_ + 1)[(c)]))
                                                  ^~~~

The standard workaround is to cast arguments to (unsigned char). I've
provided patches for gnucash for that, but they received pushback
because the compiler shouldn't error out on this undefined behaviour.
(gnucash upstream is happy with it dumping core at runtime)

Here's the bug report with more details.

https://bugs.gnucash.org/show_bug.cgi?id=797039

Is there something we can improve in the NetBSD headers so that clang
doesn't behave more pickily and gcc in this case?
 Thomas



Home | Main Index | Thread Index | Old Index