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

Windows compilation error #6

Closed
pfusik opened this issue Feb 7, 2021 · 1 comment
Closed

Windows compilation error #6

pfusik opened this issue Feb 7, 2021 · 1 comment

Comments

@pfusik
Copy link

pfusik commented Feb 7, 2021

There's a compilation error:

C:\0\src\Shrinkler>make PLATFORM=windows-64
x86_64-w64-mingw32-g++ -Wall -Wno-sign-compare -O3 -I decrunchers_bin cruncher/Shrinkler.cpp -c -o build/windows-64/Shrinkler.o
In file included from cruncher/HunkFile.h:24,
				 from cruncher/Shrinkler.cpp:22:
cruncher/HunkFile.h: In member function 'bool HunkFile::analyze()':
cruncher/doshunks.h:65:27: error: narrowing conversion of '-2147483648' from 'long int' to 'unsigned int' [-Wnarrowing]
   65 | #define HUNKF_FAST (1L<<31)
	  |                           ^
cruncher/HunkFile.h:380:9: note: in expansion of macro 'HUNKF_FAST'
  380 |    case HUNKF_FAST:
	  |         ^~~~~~~~~~

C:\0\src\Shrinkler>x86_64-w64-mingw32-g++ --version
x86_64-w64-mingw32-g++ (Rev6, Built by MSYS2 project) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

An easy fix works for me:

C:\0\src\Shrinkler>git diff
diff --git a/cruncher/doshunks.h b/cruncher/doshunks.h
index 190239e..ea4b440 100644
--- a/cruncher/doshunks.h
+++ b/cruncher/doshunks.h
@@ -62,7 +62,7 @@
 #define HUNKB_FAST     31
 #define HUNKF_ADVISORY (1L<<29)
 #define HUNKF_CHIP     (1L<<30)
-#define HUNKF_FAST     (1L<<31)
+#define HUNKF_FAST     (1u<<31)
@askeksa
Copy link
Owner

askeksa commented Feb 5, 2022

Thanks. Fixed in 9c6a97f.

@askeksa askeksa closed this as completed Feb 5, 2022
rgiot pushed a commit to cpcsdk/rust.cpclib that referenced this issue Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants