- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I ran into a strange issue when building the code with -Wconversion flag.
std::vector<int> values{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; std::uint8_t number_of_values = static_cast<uint8_t>(values.size());
The example above produces a warning:
warning #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
values.size() returns size_t, so static_cast to uint8_t should be OK.
Enviroment:
Ubuntu 18.04.2
icc (ICC) 19.0.3.199 20190206
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can confirm the same behavior for icpc v 19.0.4.
Would be really great to get a fix. It complains about lots of third-party code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can suppress it by -wd1682

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page