https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88111
Bug ID: 88111
Summary: libstdc++-v3 FTB for 16-bit int: memory_resource.cc
pool_sizes expects >16-bit int/size_t
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: jozef.l at mittosystems dot com
Target Milestone: ---
Building libstdc++-v3 for msp430-elf (16-bit int/size_t) results in the
following errors/warnings on current trunk:
> ../../../../../libstdc++-v3/src/c++17/memory_resource.cc: At global scope:
> ../../../../../libstdc++-v3/src/c++17/memory_resource.cc:825:38: warning:
> left shift count >= width of type [-Wshift-count-overflow]
> 825 | 1<<12, 1<<13, 1<<14, 1<<15, 1<<16, 1<<17,
> | ^~
> ../../../../../libstdc++-v3/src/c++17/memory_resource.cc:825:45: warning:
> left shift count >= width of type [-Wshift-count-overflow]
> 825 | 1<<12, 1<<13, 1<<14, 1<<15, 1<<16, 1<<17,
> | ^~
> ../../../../../libstdc++-v3/src/c++17/memory_resource.cc:826:10: warning:
> left shift count >= width of type [-Wshift-count-overflow]
> 826 | 1<<20, 1<<21, 1<<22 // 4MB should be enough for anybody
> | ^~
> ../../../../../libstdc++-v3/src/c++17/memory_resource.cc:826:17: warning:
> left shift count >= width of type [-Wshift-count-overflow]
> 826 | 1<<20, 1<<21, 1<<22 // 4MB should be enough for anybody
> | ^~
> ../../../../../libstdc++-v3/src/c++17/memory_resource.cc:826:24: warning:
> left shift count >= width of type [-Wshift-count-overflow]
> 826 | 1<<20, 1<<21, 1<<22 // 4MB should be enough for anybody
> | ^~
> ../../../../../libstdc++-v3/src/c++17/memory_resource.cc:827:3: error:
> narrowing conversion of '-32768' from 'int' to 'std::size_t' {aka 'unsigned
> int'} [-Wnarrowing]
> 827 | };
> | ^
> ../../../../../libstdc++-v3/src/c++17/memory_resource.cc: In function
> 'std::pmr::pool_options
> std::pmr::{anonymous}::munge_options(std::pmr::pool_options)':
> ../../../../../libstdc++-v3/src/c++17/memory_resource.cc:860:29: error:
> non-constant condition for static assertion
> 860 | static_assert(std::__ispow2(pool_sizes[0]));
> | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~