提交 21ac2b96 编写于 作者: A Andy Polyakov

Eliminate gcc -pedantic warnings.

上级 79e1dd65
...@@ -357,7 +357,12 @@ static int dl_pathbyaddr(void *addr,char *path,int sz) ...@@ -357,7 +357,12 @@ static int dl_pathbyaddr(void *addr,char *path,int sz)
struct shl_descriptor inf; struct shl_descriptor inf;
int i,len; int i,len;
if (addr == NULL) addr = dl_pathbyaddr; if (addr == NULL)
{
union { int(*f)(void*,char*,int); void *p; } t =
{ dl_pathbyaddr };
addr = t.p;
}
for (i=-1;shl_get_r(i,&inf)==0;i++) for (i=-1;shl_get_r(i,&inf)==0;i++)
{ {
......
...@@ -423,7 +423,12 @@ static int dlfcn_pathbyaddr(void *addr,char *path,int sz) ...@@ -423,7 +423,12 @@ static int dlfcn_pathbyaddr(void *addr,char *path,int sz)
Dl_info dli; Dl_info dli;
int len; int len;
if (addr == NULL) addr = dlfcn_pathbyaddr; if (addr == NULL)
{
union { int(*f)(void*,char*,int); void *p; } t =
{ dlfcn_pathbyaddr };
addr = t.p;
}
if (dladdr(addr,&dli)) if (dladdr(addr,&dli))
{ {
......
...@@ -635,7 +635,12 @@ static int win32_pathbyaddr(void *addr,char *path,int sz) ...@@ -635,7 +635,12 @@ static int win32_pathbyaddr(void *addr,char *path,int sz)
MODULE32 module_first, module_next; MODULE32 module_first, module_next;
int len; int len;
if (addr == NULL) addr = win32_pathbyaddr; if (addr == NULL)
{
union { int(*f)(void*,char*,int); void *p; } t =
{ win32_pathbyaddr };
addr = t.p;
}
dll = LoadLibrary(TEXT(DLLNAME)); dll = LoadLibrary(TEXT(DLLNAME));
if (dll == NULL) if (dll == NULL)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册