llvm / llvm/llvm-project

clang fails to compile most recent enchant version 2.8.17

Open
#207,238 1 comment 0 reactions 0 assignees View on GitHub
clang:driver
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Hey folks,

I downloaded the latest enchant version here:

https://github.com/rrthomas/enchant/releases/download/v2.8.17/enchant-2.8.17.tar.gz

I tested compiling it:

- clang version 22.1.0 fails to compile
- gcc version 16.1.0 works fine and compiles

The error clang shows is this:

"string file not found"

aka:

Making all in providers
make[2]: Entering directory '/home/x/temp/software_manager/enchant-2.8.17/providers'
/bin/sh ../libtool --tag=CXX --mode=compile clang++ -DHAVE_CONFIG_H -I. -I.. -I.. -isystem ../libgnu -isystem ../libgnu -I../lib -I/home/Programs/Glib/2.88.2/include -I/home/Programs/Libffi/3.6.0/include -I/home/Programs/Glib/2.88.2/include/glib-2.0 -I/home/Programs/Glib/2.88.2/lib/glib-2.0/include -I/home/Programs/Zlib/1.3.2//include -I/home/Programs/Utillinux/2.42.2/include/libmount -I/home/Programs/Utillinux/2.42.2/include/blkid -I/usr/include/sysprof-6 -pthread -D_ENCHANT_BUILD=1 -W -Waddress -Wall -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wcomment -Wcomments -Wconversion-null -Wcpp -Wctor-dtor-privacy -Wdate-time -Wdelete-incomplete -Wdelete-non-virtual-dtor -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wdouble-promotion -Weffc++ -Wempty-body -Wendif-labels -Wenum-compare -Wextra -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wformat-y2k -Wformat-zero-length -Wfree-nonheap-object -Wignored-qualifiers -Winit-self -Winline -Wint-to-pointer-cast -Winvalid-offsetof -Winvalid-pch -Wlogical-not-parentheses -Wmain -Wmemset-transposed-args -Wmissing-braces -Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-dirs -Wmultichar -Wnarrowing -Wnon-virtual-dtor -Wnonnull -Wodr -Woverflow -Woverlength-strings -Woverloaded-virtual -Wpacked -Wparentheses -Wpointer-arith -Wpragmas -Wreorder -Wreturn-local-addr -Wreturn-type -Wsequence-point -Wshadow -Wshift-count-negative -Wshift-count-overflow -Wsign-promo -Wsizeof-array-argument -Wsizeof-pointer-memaccess -Wstack-protector -Wstrict-aliasing -Wstrict-overflow -Wsuggest-override -Wswitch -Wswitch-bool -Wtrigraphs -Wtype-limits -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvla -Wvolatile-register-var -Wwrite-strings -Wzero-as-null-pointer-constant -Wno-missing-field-initializers -I/home/Programs/Hunspell/1.7.3/include/hunspell -DENCHANT_HUNSPELL_DICT_DIR='"/home/Programs/Enchant/2.8.17/share/hunspell"' -fPIC -MT enchant_hunspell_la-enchant_hunspell.lo -MD -MP -MF .deps/enchant_hunspell_la-enchant_hunspell.Tpo -c -o enchant_hunspell_la-enchant_hunspell.lo `test -f 'enchant_hunspell.cpp' || echo './'`enchant_hunspell.cpp
libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I.. -I.. -isystem ../libgnu -isystem ../libgnu -I../lib -I/home/Programs/Glib/2.88.2/include -I/home/Programs/Libffi/3.6.0/include -I/home/Programs/Glib/2.88.2/include/glib-2.0 -I/home/Programs/Glib/2.88.2/lib/glib-2.0/include -I/home/Programs/Zlib/1.3.2//include -I/home/Programs/Utillinux/2.42.2/include/libmount -I/home/Programs/Utillinux/2.42.2/include/blkid -I/usr/include/sysprof-6 -pthread -D_ENCHANT_BUILD=1 -W -Waddress -Wall -Wattributes -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wcomment -Wcomments -Wconversion-null -Wcpp -Wctor-dtor-privacy -Wdate-time -Wdelete-incomplete -Wdelete-non-virtual-dtor -Wdeprecated -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wdouble-promotion -Weffc++ -Wempty-body -Wendif-labels -Wenum-compare -Wextra -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-signedness -Wformat-y2k -Wformat-zero-length -Wfree-nonheap-object -Wignored-qualifiers -Winit-self -Winline -Wint-to-pointer-cast -Winvalid-offsetof -Winvalid-pch -Wlogical-not-parentheses -Wmain -Wmemset-transposed-args -Wmissing-braces -Wmissing-declarations -Wmissing-field-initializers -Wmissing-include-dirs -Wmultichar -Wnarrowing -Wnon-virtual-dtor -Wnonnull -Wodr -Woverflow -Woverlength-strings -Woverloaded-virtual -Wpacked -Wparentheses -Wpointer-arith -Wpragmas -Wreorder -Wreturn-local-addr -Wreturn-type -Wsequence-point -Wshadow -Wshift-count-negative -Wshift-count-overflow -Wsign-promo -Wsizeof-array-argument -Wsizeof-pointer-memaccess -Wstack-protector -Wstrict-aliasing -Wstrict-overflow -Wsuggest-override -Wswitch -Wswitch-bool -Wtrigraphs -Wtype-limits -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-parameter -Wunused-result -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvla -Wvolatile-register-var -Wwrite-strings -Wzero-as-null-pointer-constant -Wno-missing-field-initializers -I/home/Programs/Hunspell/1.7.3/include/hunspell -DENCHANT_HUNSPELL_DICT_DIR=\"/home/Programs/Enchant/2.8.17/share/hunspell\" -fPIC -MT enchant_hunspell_la-enchant_hunspell.lo -MD -MP -MF .deps/enchant_hunspell_la-enchant_hunspell.Tpo -c enchant_hunspell.cpp -fPIC -DPIC -o .libs/enchant_hunspell_la-enchant_hunspell.o
enchant_hunspell.cpp:41:10: fatal error: 'string' file not found
41 | #include
| ^~~~~~~~
1 error generated.
make[2]: *** [Makefile:1048: enchant_hunspell_la-enchant_hunspell.lo] Error 1
make[2]: Leaving directory '/home/x/temp/software_manager/enchant-2.8.17/providers'
make[1]: *** [Makefile:911: all-recursive] Error 1
make[1]: Leaving directory '/home/x/temp/software_manager/enchant-2.8.17'

Note that I manage to compile most of the software I use on linux via clang successfully
(I tested this in the last days, clang works extremely well, I'd even give a current ratio
of 99% of what works with gcc also works via clang), so seeing this error shown above,
whereas gcc works fine for the same code base, in a fairly small program such as enchant,
was surprising. At any rate, perhaps the more recent LLVM version fixed this, I was not
yet able to test it, so this is just for reporting the issue. Please feel free to close this for
any reason at any moment in time. Thanks for reading!

Contributor guide

Open the contributing guide

Research direction

Reproduce the release build using the clang++ command shown, starting with providers/enchant_hunspell.cpp at its include and the generated providers/Makefile rule. Compare the clang and gcc include or toolchain setup, then verify that the enchant-2.8.17 build completes with clang++ without the missing-header error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.