简体   繁体   English

无效的C99 IL表达种类

[英]Invalid C99 IL expression kind

I'm writing an application for a VxWorks project and hence use the diab compiler. 我正在为VxWorks项目编写应用程序,因此使用了diab编译器。 Now, I'm trying to cast a void* to a MyType* but I get some weird error, what am I doing wrong I'm wondering, my code: 现在,我正在尝试将void*转换为MyType*但出现一些奇怪的错误,我在想什么,我在做错什么,我的代码:

 int switch_transaction_management(map_type_t pType, void* pData)
 {
     switch_port_t pPort;
     switch_VID_t pVid;
     switch_vpws_t pVpws;

        switch (pType) {
        case MAP_TYPE_PORT:
            pPort = (switch_port_t*) pData;
...
...

and the error I get is: 我得到的错误是:

: internal error: assertion failed: Invalid C99 IL expression kind (./../src/eparse/lower_c99.c, line 3690)
            pPort = (switch_port_t*) pData;

Doesn't make any sense to me, anyone? 对我来说没有任何意义吗?

Your code is incorrect. 您的代码不正确。 You have: 你有:

switch_port_t pPort;

followed by: 其次是:

pPort = (switch_port_t*) pData;

You're trying to assign a value of type switch_port_t* to an object of type switch_port_t , which is invalid and should have caused the compiler to issue an error message. 你试图类型的值赋给switch_port_t*到类型的对象switch_port_t ,这是无效的,应该引起编译器发出错误信息。

The compiler you're using is also incorrect. 您使用的编译器也不正确。 Rather than issuing an error message, your code has triggered a bug in the compiler itself: 您的代码没有发出错误消息,而是触发了编译器本身的错误:

internal error: assertion failed: Invalid C99 IL expression kind (./../src/eparse/lower_c99.c, line 3690)

(The "IL" is probably an abbreviation for "Intermediate Language", something used internally by the compiler.) (“ IL”可能是“中间语言”的缩写,由编译器内部使用。)

You should correct your code (it's likely that that will avoid triggering the compiler bug). 您应该更正您的代码(很可能避免触发编译器错误)。 I don't know whether you should drop the * in the cast or change the declaration of pPort . 我不知道您应该在演员表中删除*还是更改pPort的声明。

You should also, as Deduplicator suggested, report the compiler bug to the maintainers of the compiler you're using. 还应按照Deduplicator的建议,将编译器错误报告给所使用的编译器的维护者。 Provide a small test case that exhibits the problem and as much information as seems reasonable (or a little more) about your environment, the version of the compiler you're using, and so forth. 提供一个小的测试用例,以显示问题以及有关您的环境,所使用的编译器版本等合理(或更多)信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM