fts.c has no business to #define reserved identifiers

Florian Weimer fweimer at redhat.com
Tue Aug 12 09:01:31 UTC 2014


On 08/12/2014 10:34 AM, Florian Festi wrote:
> On 08/10/2014 10:25 PM, Krzysztof Żelechowski wrote:
>> Is:
>>
>> #   define __set_errno(val) (*__errno_location ()) = (val)
>>
>> #   define __open           open
>>
>> #   define __close           close
>>
>> #   define __fchdir          fchdir
>>
>>
>>
>> Why do you do that?  It is illegal.
>
> Please don't tell the Police. We all have families.
> If you look a bit closer you might realize that this passage is
> surrounded by the #else block of a #if defined(_LIBC) directive.

Applications must not define the macro _LIBC, it's internal to glibc and 
other libcs.  Perhaps you're confusing it with the __STDC__ macro?

Krzysztof is right, and the quoted #defines are actually processed 
during compilation (on GNU/Linux at least).

-- 
Florian Weimer / Red Hat Product Security


More information about the Rpm-list mailing list