Sergey Bugaev, le mar. 25 avril 2023 00:09:58 +0300, a ecrit: > What I should rather look into is marking __hurd_fail and friends with > __attribute__((cold)); that would take care of all the error branches > everywhere automatically without having to mark things up.
Yes, that'd probably be great :) > But I did a quick grep and found nothing using __attribute__((cold)) > yet, so I don't know what the right way of using it would be > (and maybe it's not being used intentionally?). It's probably that just nobody thought about adding it. > I'm thinking it should probably go into misc/sys/cdefs.h as __COLD (or > __attribute_cold?). Something like this: > > #if __glibc_has_attribute (cold) > #define __COLD __attribute__ ((cold)) > #else > #define __COLD > #endif > > What do you think? Yes! Though you can even make it #if __GNUC_PREREQ (4,3) || __glibc_has_attribute (__cold__) Samuel