- 論壇徽章:
- 1
|
- #include "stdio.h"
- #include <time.h>
- #include <sys/time.h>
- #include <math.h>
- #include <string.h>
- #include <sys/ioctl.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include "errno.h"
- #include <pthread.h>
- #include <stdint.h>
- #include <signal.h>
- #include<sys/time.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <dirent.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/syscall.h>
- #include <sys/select.h>
- #include <ctype.h>
- #include <limits.h>
- typedef enum {
- QMI_RESULT_TYPE_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum. Do not change or use*/
- QMI_RESULT_SUCCESS_V01 = 0,
- QMI_RESULT_FAILURE_V01 = 1,
- QMI_RESULT_TYPE_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum. Do not change or use*/
- }qmi_result_type_v01;
- typedef struct {
- qmi_result_type_v01 result;
- /**< Result code
- - QMI_RESULT_SUCCESS
- - QMI_RESULT_FAILURE
- */
- }qmi_response_type_v01; /* Type */
- typedef struct {
- /* Mandatory */
- /* Result Code */
- /**< Standard response type. */
- /* int ab; */ //但如果我加上這個int ab后,再用g++ test.c,是可以編譯過的。
- qmi_response_type_v01 resp;
- /**< \n
- (Extended sizes to accommodate LTE.)
- */
- }nas_get_rf_band_info_resp_msg_v01; /* Message */
- int main(int argc, char **argv)
- {
- int s;
- int ret;
- nas_get_rf_band_info_resp_msg_v01 getBandResp = {0};
- while (1);
-
- return 0;
- }
復(fù)制代碼 上面是我提取出來的代碼。鑒于項目的原因,我們不能修改makefile,也最好不要先分配getBandResp后再用memset,請問大俠有什么解決辦法呢?
謝謝!
如果用gcc編譯,是可以的,但g++編譯就出錯:
test111.c: In function 鈥榠nt main(int, char**)鈥
test111.c:333:55: error: invalid conversion from 鈥榠nt鈥to 鈥榪mi_result_type_v01鈥[-fpermissive]
nas_get_rf_band_info_resp_msg_v01 getBandResp = {0}; |
|