Opened 11 years ago
Closed 9 years ago
#5761 closed Bugs (invalid)
warning im MPL source
Reported by: | anonymous | Owned by: | Aleksey Gurtovoy |
---|---|---|---|
Milestone: | To Be Determined | Component: | mpl |
Version: | Boost 1.47.0 | Severity: | Cosmetic |
Keywords: | Cc: |
Description
I get warning in Visual C++ 10, 32 bit mode (strangely, 64 bit mode is warning free):
p:\app\3pp\boost\mpl\print.hpp(51): warning C4308: negative integral constant converted to unsigned type
It is line:
enum { n = sizeof(T) + -1 };
Changing it into:
enum { n = sizeof(T) - 1 };
got rid the warning.
Attachments (1)
Change History (5)
by , 11 years ago
Attachment: | print.patch added |
---|
comment:1 by , 11 years ago
Why not
enum { n = sizeof(T) + 1 };
?
I've attached patch for this version.
comment:2 by , 10 years ago
Why was this not committed to the base? I still get the same error with boost 1.53 unless I change the line as denoted above.
comment:4 by , 9 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
This is not a bug. mpl::print is supposed to generate a warning. Check the template instantiation backtrace to find the reason for the warning.
Patch for trunk svn version