Boost logo

Boost Users :

From: Kevin Wheatley (hxpro_at_[hidden])
Date: 2005-11-24 05:03:01


Jeroen Akershoek wrote:
> 1) the indicated type is incomplete
> std::basic_istream<charT> m_is; // stream for
> parsing numbers.
> Not sure about this one. Missing include somewhere or maybe SGIs STL
> is f00bar

Compiling which file?

> 2) The indicated enumeration value is out of "int" range.
> enum npos_type { npos = (size_type)-1 };
> I assume it's the same problem as with IBMCPP. Don't know if MIPSpro
> can have 64-bits enums.

>From SGIs *C* manual pages:
<quote>
The integer type chosen to represent the values of an enumeration type
(3.5.2.2).

    The int type is always used.

    Note: long or long long enumerations are not supported.
</quote>

So I assume despite an enum not being an integral type the same
applies to enum in C++ I couldn't see an option to change in fact it
is going to ba an ABI thing, so not changeable.

#include <iostream>
#include <cstddef>

int main(int argc, char** argv)
{
  int intType;
  long longType;
  enum enumType { bar = -1 };
  size_t size_tType;
  std::cout << "sizeof(int) = " << sizeof(intType) << std::endl;
  std::cout << "sizeof(long) = " << sizeof(longType) << std::endl;
  std::cout << "sizeof(size_t) = " << sizeof(size_tType) << std::endl;
  std::cout << "sizeof(enum) = " << sizeof(enumType) << std::endl;
  return 0;
}

CC -o enum enum.cpp -n32 -mips4
sizeof(int) = 4
sizeof(long) = 4
sizeof(size_t) = 4
sizeof(enum) = 4
CC -o enum enum.cpp -64 -mips4
sizeof(int) = 4
sizeof(long) = 8
sizeof(size_t) = 8
sizeof(enum) = 4

I'm not sure if this holds across other 64 bit platforms/ABIs. I think
the Itanium ABI allows a bitfield specifier so you can control the
size indiectly as it is still placed into the smallest integral type
that the width of the bitfield allows. The ARM ABI would also follow a
'smallest integral type that holds the values' so could be
signed/unsigned etc.

All of which suggest that the line in question is incorrect to assume
the underlying type and the cast is bad... in some way.

> 3) Threading is disabled: _SGI_MP_SOURCE is undefined

it should be. The jam file does both that define and a link with
pthreads whn compiling <threading>multi

I've not tried a 64 bit build but the jam files indicate support for
such things...

<address-model>32 for N32 and <address-model>64 is for 64 bit

<architecture>mips3 and <architecture>mips4 for selection of
architecture

these could be passed to the bjam line thus:

bjam "-sBUILD=<address-model>64 <architecture>mips4" -sTOOLS=mipspro

Kevin

-- 
| Kevin Wheatley, Cinesite (Europe) Ltd | Nobody thinks this      |
| Senior Technology                     | My employer for certain |
| And Network Systems Architect         | Not even myself         |

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net