Search code examples
c++gcccompiler-errorstypedef

What does this mean: "error: invalid combination of multiple type-specifiers"


I'm getting a compiler error on FreeBSD:

error: invalid combination of multiple type-specifiers

From the C++ Code:

typedef unsigned off_t uoff_t;

Not sure what the gcc compiler is trying to tell me.


Solution

  • Use typedef std::make_unsigned_t< off_t > uoff_t; since C++14 instead to achieve the desired effect.

    Use typedef std::make_unsigned< off_t >::type uoff_t; since C++11.

    Use typedef boost::make_unsigned< off_t >::type uoff_t; before C++11.