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

"narrowing conversion" build error #196

Closed
jeanthom opened this issue Mar 19, 2022 · 1 comment
Closed

"narrowing conversion" build error #196

jeanthom opened this issue Mar 19, 2022 · 1 comment

Comments

@jeanthom
Copy link
Contributor

Spotted while bumping Fedora packages from v0.7.0 to v0.8.0:

[ 52%] Building CXX object CMakeFiles/openFPGALoader.dir/src/ftdiJtagBitbang.cpp.o
/usr/bin/g++ -DATTACH_KERNEL -DDATA_DIR=\"/usr/share\" -DENABLE_CMSISDAP=1 -DFTDI_VERSION=105 -DHAS_ZLIB=1 -DISE_DIR=\"/opt/Xilinx/14.7\" -DUSE_UDEV -DVERSION=\"v0.8.0\" -I/usr/include/libusb-1.0 -I/usr/include/libftdi1 -I/usr/include/hidapi -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -std=gnu++11 -MD -MT CMakeFiles/openFPGALoader.dir/src/ftdiJtagBitbang.cpp.o -MF CMakeFiles/openFPGALoader.dir/src/ftdiJtagBitbang.cpp.o.d -o CMakeFiles/openFPGALoader.dir/src/ftdiJtagBitbang.cpp.o -c /builddir/build/BUILD/openFPGALoader-0.8.0/src/ftdiJtagBitbang.cpp
In file included from /builddir/build/BUILD/openFPGALoader-0.8.0/src/jtag.cpp:29:
/builddir/build/BUILD/openFPGALoader-0.8.0/src/part.hpp:148:1: error: narrowing conversion of '4294967294' from 'unsigned int' to 'int' [-Wnarrowing]
  148 | };
      | ^

(full log)

@jeanthom
Copy link
Contributor Author

Maybe int is inappropriate here and should be changed to unsigned int or uint32_t?

trabucayre added a commit that referenced this issue Mar 19, 2022
Use uint32_t for misc_dev_list (fixes #196)
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

1 participant