【发布时间】:2011-05-13 22:20:30
【问题描述】:
我有一些类似于以下的代码:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdarg.h>
#include <sys/ldr.h>
int main (int argc, char **argv)
{
int liRC = 0;
struct shl_descriptor *lstModDesc;
int liEach;
char lsBaseName[513];
char *lsTheName;
for( liEach = 0; liRC == 0; liEach++ )
{
liRC = shl_get( liEach, &lstModDesc );
if( liRC == 0 )
{
strcpy( lsBaseName, lstModDesc->filename );
lsTheName = (char *)basename( lsBaseName );
/* do more stuff */
}
}
return 0;
}
它正在做的是枚举附加到二进制文件的所有共享库。这在 AIX 5.3 上编译得很好,但在 AIX 7.1 上我得到以下关于 lstModDesc 的信息:
“modulename.c”,第 2553.30 行:1506-285 (S) 间接运算符不能 a 应用于指向不完整的指针 结构或联合。
我找不到在我的 aix 5.3 机器上定义 shl_get 的位置,也找不到定义 struct shl_descriptor 的位置。我难住了。我什至尝试将带有 -E 标志的预处理输出输出到编译器,但没有成功。我在 /usr/include 中做了一个递归 grep。还有其他地方我应该搜索吗?这些定义在哪里?
【问题讨论】: