Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.1b build fails on Cygwin due to wchar_t narrowing #6549

Closed
ridiculousfish opened this issue Jan 28, 2020 · 2 comments
Closed

3.1b build fails on Cygwin due to wchar_t narrowing #6549

ridiculousfish opened this issue Jan 28, 2020 · 2 comments
Labels
bug Something that's not working as intended
Milestone

Comments

@ridiculousfish
Copy link
Member

Andrew Schulman reports on fish-users:

Hi. In Cygwin x86_64, the build fails with a bunch of "narrowing conversion
from ‘int’ to ‘wchar_t’" errors:


[51/113] /usr/bin/g++.exe  -DBINDIR=L\"/usr/bin\"
-DCMAKE_BINARY_DIR=\"fish-3.1b1-1.x86_64/build\"
-DCMAKE_SOURCE_DIR=\"fish-3.1b1-1.x86_64/src/fish-3.1b1\"
-DDATADIR=L\"/usr/share\" -DDOCDIR=L\"/usr/share/doc/fish\"
-DLOCALEDIR=\"/usr/sh
are/locale\" -DPREFIX=L\"/usr\" -DSYSCONFDIR=L\"/etc\" -D_REENTRANT
-D_UNICODE=1 -I. -Wno-comment -f
debug-prefix-map=fish-3.1b1-1.x86_64/build=/usr/src/debug/fish-3.1b1-1
-fdebug-prefix-map=fish-3.1b1-1.x86_64/src/fish-3.1b1=/usr/src/debug/fish-3.1b1-1
-fdiagnostics-color=always -Wall -Wextra -Wno-implicit-fallthrough
-Wno-comment -Wno-address -Wno-strict-aliasing -Wno-redundant-move  -O2 -g
-fno-exceptions -std=gnu++11 -MD -MT
CMakeFiles/fishlib.dir/src/fallback.cpp.o -MF
CMakeFiles/fishlib.dir/src/fallback.cpp.o.d -o
CMakeFiles/fishlib.dir/src/fallback.cpp.o -c
fish-3.1b1-1.x86_64/src/fish-3.1b1/src/fallback.cpp
FAILED: CMakeFiles/fishlib.dir/src/fallback.cpp.o
/usr/bin/g++.exe  -DBINDIR=L\"/usr/bin\"
-DCMAKE_BINARY_DIR=\"fish-3.1b1-1.x86_64/build\"
-DCMAKE_SOURCE_DIR=\"fish-3.1b1-1.x86_64/src/fish-3.1b1\"
-DDATADIR=L\"/usr/share\" -DDOCDIR=L\"/usr/share/doc/fish\"
-DLOCALEDIR=\"/usr/share/locale\" -DPREFIX=L\"/usr\" -DSYSCONFDIR=L\"/etc\"
-D_REENTRANT -D_UNICODE=1 -I. -Wno-comment
-fdebug-prefix-map=fish-3.1b1-1.x86_64/build=/usr/src/debug/fish-3.1b1-1
-fdebug-prefix-map=fish-3.1b1-1.x86_64/src/fish-3.1b1=/usr/src/debug/fish-3.1b1-1
-fdiagnostics-color=always -Wall -Wextra -Wno-implicit-fallthrough
-Wno-comment -Wno-address -Wno-strict-aliasing -Wno-redundant-move  -O2 -g
-fno-exceptions -std=gnu++11 -MD -MT
CMakeFiles/fishlib.dir/src/fallback.cpp.o -MF
CMakeFiles/fishlib.dir/src/fallback.cpp.o.d -o
CMakeFiles/fishlib.dir/src/fallback.cpp.o -c
fish-3.1b1-1.x86_64/src/fish-3.1b1/src/fallback.cpp
In file included from
fish-3.1b1-1.x86_64/src/fish-3.1b1/src/fallback.cpp:268:0:
fish-3.1b1-1.x86_64/src/fish-3.1b1/src/widecharwidth/widechar_width.h:45:1:
error: narrowing conversion of ‘983040’ from ‘int’ to ‘wchar_t’ inside { }
[-Wnarrowing]
};
^
fish-3.1b1-1.x86_64/src/fish-3.1b1/src/widecharwidth/widechar_width.h:45:1:
error: narrowing conversion of ‘1048573’ from ‘int’ to ‘wchar_t’ inside { }
[-Wnarrowing]
fish-3.1b1-1.x86_64/src/fish-3.1b1/src/widecharwidth/widechar_width.h:45:1:
error: narrowing conversion of ‘1048576’ from ‘int’ to ‘wchar_t’ inside { }
[-Wnarrowing]
fish-3.1b1-1.x86_64/src/fish-3.1b1/src/widecharwidth/widechar_width.h:45:1:
error: narrowing conversion of ‘1114109’ from ‘int’ to ‘wchar_t’ inside { }
[-Wnarrowing]
fish-3.1b1-1.x86_64/src/fish-3.1b1/src/widecharwidth/widechar_width.h:57:1:
error: narrowing conversion of ‘69821’ from ‘int’ to ‘wchar_t’ inside { }
[-Wnarrowing]
...


There are also lots of warnings like:

fish-3.1b1-1.x86_64/src/fish-3.1b1/src/common.cpp:1307:34: warning:
comparison is always false due to limited range of data type
[-Wtype-limits]
                    if (0x10FFFF < max_val) max_val =
static_cast<wchar_t>(0x10FFFF);
                        ~~~~~~~~~^~~~~~~~~

and

At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-redundant-move’

@ridiculousfish ridiculousfish added this to the fish 3.1.0 milestone Jan 28, 2020
@zanchey zanchey added the bug Something that's not working as intended label Jan 29, 2020
ridiculousfish added a commit that referenced this issue Jan 31, 2020
Fixes a Cygwin incompatibility. Fixes #6549

Cherry-pick from 7310619
@ridiculousfish
Copy link
Member Author

Cherry-picked into Integration_3.1.0 as 4cee045

@andrew-schulman
Copy link
Contributor

Confirmed that 7310619 fixes the build failure. Thanks.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

3 participants