mardi 1 novembre 2016

invalid conversion from 'int (*) (const void*, const void*)' to 'int (*) (const dirent**, const dirent**)' Linux g++ 64-bit compiling warning

ACE_INLINE int
ACE_OS::scandir (const ACE_TCHAR *dirname,
                 struct dirent **namelist[],
                 int (*selector)(const struct dirent *),
                 int (*comparator) (const struct dirent **f1,
                                    const struct dirent **f2))
{
#if defined (ACE_HAS_SCANDIR)
  return ::scandir (ACE_TEXT_ALWAYS_CHAR (dirname),
                    namelist,
                    selector,
#  if defined (ACE_SCANDIR_CMP_USES_VOIDPTR)
                    reinterpret_cast<int(*)(const void*, const void*)> (long(comparator)));
#  else
                    comparator);
#  endif /* ACE_SCANDIR_CMP_USES_VOIDPTR */
#else /* ! defined ( ACE_HAS_SCANDIR) */
  return ACE_OS::scandir_emulation (dirname, namelist, selector, comparator);
#endif /* ACE_HAS_SCANDIR */
}

this code works good on 32-bit compiling, but when I do 64-bit compile on it, I got warning:

/vobs/avoke/tools/sl3/ACE-5.4.4+TAO-1.4.4/ace/OS_NS_dirent.inl:

In function 'int ACE_OS::scandir(const ACE_TCHAR*, dirent***, int (*)(const dirent*), int (*)(const dirent**, const dirent**))':

/vobs/avoke/tools/sl3/ACE-5.4.4+TAO-1.4.4/ace/OS_NS_dirent.inl:174:84:

warning: invalid conversion from 'int (*) (const void*, const void*)' to 'int (*)(const dirent**, const dirent**)' [-fpermissive]
   reinterpret_cast<int(*)(const void*, const void*)> (comparator));

I tried to replace int with intptr_t, no help.

Aucun commentaire:

Enregistrer un commentaire