#401 random.h errors in 4.9.0 with -m32 due to use of __int128

v1.0 (example)
closed-invalid
nobody
None
5
2014-06-21
2014-06-18
No
f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/x86_64-w64-mingw32/include/c++/bits/random.h:106:26: error: expected unqualified-id before '__int128'
       { typedef unsigned __int128 type; };
                          ^

it appears I get this from the source line of code:

#include <algorithm>

In file included from f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/x86_64-w64-mingw32/include/c++/random:49:0,
from f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_algo.h:66,
from f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/x86_64-w64-mingw32/include/c++/algorithm:62,
from renumberids.cpp:24:

Using built-in specs.
COLLECT_GCC=f:\x86_64-4.9.0-release-win32-seh-rt_v3-rev2\mingw64\bin\g++.exe
COLLECT_LTO_WRAPPER=f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-4.9.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/home/nixman/mingw-gcc-4.9.0/x86_64-490-win32-seh-rt_v3-rev2/mingw64 --with-gxx-include-dir=/mingw64/x86_64-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=win32 --enable-libgomp --enable-libatomic --enable-libitm --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/home/nixman/mingw-gcc-4.9.0/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/home/nixman/mingw-gcc-4.9.0/prerequisites/x86_64-w64-mingw32-static --with-mpc=/home/nixman/mingw-gcc-4.9.0/prerequisites/x86_64-w64-mingw32-static --with-isl=/home/nixman/mingw-gcc-4.9.0/prerequisites/x86_64-w64-mingw32-static --with-cloog=/home/nixman/mingw-gcc-4.9.0/prerequisites/x86_64-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='x86_64-win32-seh-rev2, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/home/nixman/mingw-gcc-4.9.0/x86_64-490-win32-seh-rt_v3-rev2/mingw64/opt/include -I/home/nixman/mingw-gcc-4.9.0/prerequisites/x86_64-zlib-static/include -I/home/nixman/mingw-gcc-4.9.0/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/home/nixman/mingw-gcc-4.9.0/x86_64-490-win32-seh-rt_v3-rev2/mingw64/opt/include -I/home/nixman/mingw-gcc-4.9.0/prerequisites/x86_64-zlib-static/include -I/home/nixman/mingw-gcc-4.9.0/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/home/nixman/mingw-gcc-4.9.0/x86_64-490-win32-seh-rt_v3-rev2/mingw64/opt/lib -L/home/nixman/mingw-gcc-4.9.0/prerequisites/x86_64-zlib-static/lib -L/home/nixman/mingw-gcc-4.9.0/prerequisites/x86_64-w64-mingw32-static/lib'
Thread model: win32
gcc version 4.9.0 (x86_64-win32-seh-rev2, Built by MinGW-W64 project)
COLLECT_GCC_OPTIONS='-m32' '-Wall' '-Wextra' '-v' '-save-temps' '-ftree-parallelize-loops=0' '-floop-parallelize-all' '-ftree-slp-vectorize' '-O2' '-fprefetch-loop-arrays' '-O' '-static' '-std=c++11' '-s' '-isystem' '/libpq/' '-isystem' '/libpq/server/libpq/' '-isystem' '/prj/fltk/fltk-2.0.x-alpha-r9042/' '-isystem' '/prj/fltk/fltk-2.0.x-alpha-r9042/lib/' '-isystem' '/prj/zlib-1.2.5/' '-isystem' '/prj/boost/boost32' '-o' '32\renumberids.exe' '-mtune=core2' '-march=nocona' '-mthreads' '-pthread'
f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.0/cc1plus.exe -E -quiet -v -imultilib . -iprefix f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/ -D_MT -D_REENTRANT -U_REENTRANT -isystem /libpq/ -isystem /libpq/server/libpq/ -isystem /prj/fltk/fltk-2.0.x-alpha-r9042/ -isystem /prj/fltk/fltk-2.0.x-alpha-r9042/lib/ -isystem /prj/zlib-1.2.5/ -isystem /prj/boost/boost32 renumberids.cpp -m32 -mtune=core2 -march=nocona -mthreads -std=c++11 -Wall -Wextra -ftree-parallelize-loops=0 -floop-parallelize-all -ftree-slp-vectorize -fprefetch-loop-arrays -O2 -O -fpch-preprocess -o renumberids.ii
ignoring nonexistent directory "/prj/fltk/fltk-2.0.x-alpha-r9042"
ignoring nonexistent directory "/prj/fltk/fltk-2.0.x-alpha-r9042/lib"
ignoring duplicate directory "f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.9.0/include"
ignoring nonexistent directory "C:/Users/nixman/msys64/home/nixman/mingw-gcc-4.9.0/x86_64-490-win32-seh-rt_v3-rev2/mingw64C:/Users/nixman/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../include"
ignoring duplicate directory "f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.9.0/include-fixed"
ignoring duplicate directory "f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "C:/Users/nixman/msys64/home/nixman/mingw-gcc-4.9.0/x86_64-490-win32-seh-rt_v3-rev2/mingw64/mingw/include"

include "..." search starts here:

include <...> search starts here:

/libpq
/libpq/server/libpq
/prj/zlib-1.2.5
/prj/boost/boost32
f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/include
f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/include-fixed
f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64-mingw32/include
f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/lib/gcc/../../x86_64-w64-mingw32/include/c++
f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/lib/gcc/../../x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/.
f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/lib/gcc/../../x86_64-w64-mingw32/include/c++/backward
End of search list.
COLLECT_GCC_OPTIONS='-m32' '-Wall' '-Wextra' '-v' '-save-temps' '-ftree-parallelize-loops=0' '-floop-parallelize-all' '-ftree-slp-vectorize' '-O2' '-fprefetch-loop-arrays' '-O' '-static' '-std=c++11' '-s' '-isystem' '/libpq/' '-isystem' '/libpq/server/libpq/' '-isystem' '/prj/fltk/fltk-2.0.x-alpha-r9042/' '-isystem' '/prj/fltk/fltk-2.0.x-alpha-r9042/lib/' '-isystem' '/prj/zlib-1.2.5/' '-isystem' '/prj/boost/boost32' '-o' '32\renumberids.exe' '-mtune=core2' '-march=nocona' '-mthreads' '-pthread'
f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.0/cc1plus.exe -fpreprocessed renumberids.ii -quiet -dumpbase renumberids.cpp -m32 -mtune=core2 -march=nocona -mthreads -auxbase renumberids -O2 -O -Wall -Wextra -std=c++11 -version -ftree-parallelize-loops=0 -floop-parallelize-all -ftree-slp-vectorize -fprefetch-loop-arrays -o renumberids.s
GNU C++ (x86_64-win32-seh-rev2, Built by MinGW-W64 project) version 4.9.0 (x86_64-w64-mingw32)
compiled by GNU C version 4.9.0, GMP version 6.0.0, MPFR version 3.1.2-p8, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (x86_64-win32-seh-rev2, Built by MinGW-W64 project) version 4.9.0 (x86_64-w64-mingw32)
compiled by GNU C version 4.9.0, GMP version 6.0.0, MPFR version 3.1.2-p8, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: ecb4f96dd9b99b65be5685f5bc9ae309
In file included from f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/x86_64-w64-mingw32/include/c++/random:49:0,
from f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/x86_64-w64-mingw32/include/c++/bits/stl_algo.h:66,
from f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/x86_64-w64-mingw32/include/c++/algorithm:62,
from renumberids.cpp:24:
f:/x86_64-4.9.0-release-win32-seh-rt_v3-rev2/mingw64/x86_64-w64-mingw32/include/c++/bits/random.h:106:26: error: expected unqualified-id before 'int128'
{ typedef unsigned
int128 type; };
^
renumberids.cpp: In function 'std::string strrepeat(std::string, int)':
renumberids.cpp:140:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (size_t i=1; i <= n; i++) {
^
renumberids.cpp: In function 'std::string pctencode(std::string, bool, bool, bool)':
renumberids.cpp:819:45: warning: comparison is always true due to limited range of data type [-Wtype-limits]
(s[strIdx] >= 0x7b && s[strIdx] <= 0xff)
^
renumberids.cpp: At global scope:
renumberids.cpp:1607:61: warning: unused parameter 'errs' [-Wunused-parameter]
bool AddReport(VSID& ids, std::string filepath, std::string errs) { //.report.txt
^

1 Attachments

Discussion

  • Jim Michaels

    Jim Michaels - 2014-06-18

    my understanding of the __int128 type from gcc documentation is that it is ONLY available for 64-bit compilation and nonexistent for 32-bit architectures. with the -m32 switch, __int128 does not exist, so this is the reason for the compile error on the <random> header.

     
    Last edit: Jim Michaels 2014-06-18
  • Jim Michaels

    Jim Michaels - 2014-06-18

    sorry, original post I did not escape the _'s in __int128 so wiki eliminated them for me. :-( grr.

    I don't like fighting with wikis, they don't belong on programmer's bug tracking systems. plain text is nice.

     
  • Jim Michaels

    Jim Michaels - 2014-06-18

    here is a possible patch that I hope should work. it just uses unsigned long long instead of unsigned __int128. I do not know the side effects this will have on the code reduceing the bit widths for a random number generator.

     
    Attachments
  • Jim Michaels

    Jim Michaels - 2014-06-19

    here's the dependency.

    stl_algo.h:#include <random>     // for std::uniform_int_distribution
    
     
  • Jonathan Yong

    Jonathan Yong - 2014-06-21
    • status: open --> closed-invalid
     
  • Jonathan Yong

    Jonathan Yong - 2014-06-21

    Toolchain is not multilib capable, -m32 not expected to work.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks