Opened 6 years ago

Last modified 6 years ago

#12838 new Bugs

Invalid assignment in iostreams large_file_test.cpp

Reported by: stephen.clamage@… Owned by: Jonathan Turkanis
Milestone: To Be Determined Component: iostreams
Version: Boost 1.63.0 Severity: Problem
Keywords: Cc:

Description

/libs/iostreams/test/large_file_test.cpp, line 337 char buf[1] = { z + 1 }; z is type int

The implicit narrowing conversion from int to char is an error in C++11. With Clang and Oracle Studio it is an unconditional error. With EDG-based compilers, it is an error if you specify strict compliance.

The fix is trivial: char buf[1] = { char(z + 1) };

Change History (2)

comment:1 by anonymous, 6 years ago

Summary: Invalid initializer in iostreams/large_file_terstInvalid assignment in iostreams/large_file_terst

comment:2 by ste, 6 years ago

Summary: Invalid assignment in iostreams/large_file_terstInvalid assignment in iostreams large_file_test.cpp
Note: See TracTickets for help on using tickets.