kopia lustrzana https://gitlab.com/sane-project/backends
Merge branch 'fix-dll-compiler-warnings' into 'master'
Address dll compiler warnings See merge request sane-project/backends!269merge-requests/213/head
commit
37f96cc800
|
@ -89,6 +89,20 @@ posix_dlsym (void *handle, const char *func)
|
||||||
}
|
}
|
||||||
# pragma GCC diagnostic pop
|
# pragma GCC diagnostic pop
|
||||||
|
|
||||||
|
/* Similar to the above, GCC also warns about conversion between
|
||||||
|
pointers to functions. The ISO C standard says that invoking a
|
||||||
|
converted pointer to a function whose type is not compatible with
|
||||||
|
the pointed-to type, the behavior is undefined. Although GCC is
|
||||||
|
correct to warn about this, the dll backend has been using these
|
||||||
|
conversions without issues for a very long time already.
|
||||||
|
|
||||||
|
Rather than push/pop around every use, which would get very ugly
|
||||||
|
real fast, ignore this particular warning for the remainder of
|
||||||
|
the file.
|
||||||
|
*/
|
||||||
|
# pragma GCC diagnostic ignored "-Wpragmas" /* backward compatibility */
|
||||||
|
# pragma GCC diagnostic ignored "-Wcast-function-type"
|
||||||
|
|
||||||
/* Older versions of dlopen() don't define RTLD_NOW and RTLD_LAZY.
|
/* Older versions of dlopen() don't define RTLD_NOW and RTLD_LAZY.
|
||||||
They all seem to use a mode of 1 to indicate RTLD_NOW and some do
|
They all seem to use a mode of 1 to indicate RTLD_NOW and some do
|
||||||
not support RTLD_LAZY at all. Hence, unless defined, we define
|
not support RTLD_LAZY at all. Hence, unless defined, we define
|
||||||
|
@ -799,7 +813,8 @@ read_dlld (void)
|
||||||
DIR *dlld;
|
DIR *dlld;
|
||||||
struct dirent *dllconf;
|
struct dirent *dllconf;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
char conffile[PATH_MAX], dlldir[PATH_MAX];
|
char dlldir[PATH_MAX];
|
||||||
|
char conffile[PATH_MAX + strlen("/") + NAME_MAX];
|
||||||
size_t len, plen;
|
size_t len, plen;
|
||||||
const char *dir_list;
|
const char *dir_list;
|
||||||
char *copy, *next, *dir;
|
char *copy, *next, *dir;
|
||||||
|
@ -851,7 +866,7 @@ read_dlld (void)
|
||||||
|| (dllconf->d_name[len-1] == '#'))
|
|| (dllconf->d_name[len-1] == '#'))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
snprintf (conffile, PATH_MAX, "%s/%s", dlldir, dllconf->d_name);
|
snprintf (conffile, sizeof(conffile), "%s/%s", dlldir, dllconf->d_name);
|
||||||
|
|
||||||
DBG (5, "sane_init/read_dlld: considering %s\n", conffile);
|
DBG (5, "sane_init/read_dlld: considering %s\n", conffile);
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue