这是什么意思:“错误:多个类型说明符的无效组合”

发布于 2024-09-28 22:01:27 字数 212 浏览 4 评论 0原文

我在 FreeBSD 上遇到编译器错误:

error: invalid combination of multiple type-specifiers

来自 C++ 代码:

typedef unsigned off_t uoff_t;

不确定 gcc 编译器试图告诉我什么。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吹梦到西洲 2024-10-05 22:01:27

除非 off_t 是一个宏,否则它只是一个语法错误。

unsigned 不能添加到 typedef 类型或用于修改此类类型。

干杯&呵呵,,

Unless off_t is a macro, it's simply a syntax error.

unsigned is not something you can add to a typedef'ed type or use to modify such a type.

Cheers & hth.,

呆° 2024-10-05 22:01:27

使用 typedef std::make_unsigned_t关闭_t> uoff_t; Since C++14 改为实现想要的效果。

使用 typedef std::make_unsignedoff_t >::type uoff_t; 自 C++11 起

使用 typedef boost::make_unsigned< off_t >::type uoff_t; 在 C++11 之前。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文