On Sat, Jul 31, 2021 at 2:05 PM Mattia Verga via devel
<devel@lists.fedoraproject.org> wrote:
> I need some help with Rawtherapee FTB with the recent mass rebuild:
>
> https://koji.fedoraproject.org/koji/taskinfo?taskID=72487558
>
> I tried asking upstream, but they weren't too friendly, they suggested
> that may be a toolchain problem:
>
> https://github.com/Beep6581/RawTherapee/issues/6324
>
> Is it possible they're right?

The file rtengine/myfile.cc overrides a number of glibc functions.
One of them is fclose; see line 193.  The compiler sees this code in
wchar.h:

#if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
# ifndef __attr_dealloc_fclose
#   if defined __has_builtin
#     if __has_builtin (__builtin_fclose)
/* If the attribute macro hasn't been defined yet (by <stdio.h>) and
   fclose is a built-in, use it.  */
#      define __attr_dealloc_fclose __attr_dealloc (__builtin_fclose, 1)
#     endif
#   endif
# endif
# ifndef __attr_dealloc_fclose
#  define __attr_dealloc_fclose /* empty */
# endif

That leads to the open_wmemstream declaration expanding to this:

extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc)
noexcept (true)
  __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (fclose, 1)));

Apparently that works great with the glibc declaration of fclose, but
not so great with the myfile.{cc,h} version, which you will note is
lacking all of the attributes that the glibc headers give it.

If upstream wants to override glibc functions, they should make the
function declarations match.
-- 
Jerry James
http://www.jamezone.org/
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to