c - func 之前预期为 '=' 、 ',' 、 ';' 、 'asm' 或 '__attribute__'

标签 c linux unix linux-device-driver

我有以下功能 当我编译整个文件时,它给了我一个特定的错误:

功能:

static boolean
2388 e1000_phys_port (pic_t *pic, e1000_t *e1000)
2389 {
2390         pic->pic_flags = 0;
2391 
2392         switch (pic->pic_id) {
2393         case I2C_ID_VSERIES_GIGE_PIC:
2394                 e1000->e1000_port_count = fwdd_vjx_get_e1000_ports();
2395                 break;
2396         default:
2397                 syslog(LOG_ERR, "%s: unknown I2C ID\n", e1000->pic_name);
2398                 return(FALSE);
2399         }
2400 
2401         return(TRUE);  
2402 }

错误:

2388: error:expected '=', ',', ';', 'asm' or '__attribute__' before e1000_phys_port

如果有人能尽快帮我解决这个问题!

最佳答案

booleannot a type in C 。 (除非你 typedef 自己在某个地方编辑过) – Russell Zahniser

@RussellZahniser 的意思是没有名为 boolean 的类型在 C 中,除非它是使用 typedef 定义的(或 #define ),例如 typedef int boolean; 。 – 半胱天冬 enzyme

你应该#include <stdbool.h>并使用返回类型 bool , 如果可以的话。 – 克拉斯·林德巴克

关于c - func 之前预期为 '=' 、 ',' 、 ';' 、 'asm' 或 '__attribute__',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23343429/

相关文章:

linux - linux键盘驱动源码

perl - 使用 Net :SSH:Perl module 时的协议(protocol)错误

java - 在 websphere 中导致的日期格式问题

c - 将结构指针作为参数传递

c - 以 void *a 和指针函数作为参数的函数

c - 什么是看门狗?

c++ - 如何在linux上使用mingw编译glog生成glog dll

c++ - 我们可以从父进程中读取子进程的环境变量吗

c - 接收到用户定义的信号时,进程不会取消暂停

在 C 语言中比较和交换机器码