svn commit: r304011 - head/libexec/rtld-elf

Ravi Pokala rpokala at mac.com
Tue Aug 16 15:32:54 UTC 2016


-----Original Message-----
From: <owner-src-committers at freebsd.org> on behalf of Bryan Drewery <bdrewery at FreeBSD.org>
Organization: FreeBSD
Date: 2016-08-16, Tuesday at 03:30
To: Ngie Cooper <yaneurabeya at gmail.com>, Konstantin Belousov <kib at FreeBSD.org>
Cc: <src-committers at freebsd.org>, <svn-src-all at freebsd.org>, <svn-src-head at freebsd.org>
Subject: Re: svn commit: r304011 - head/libexec/rtld-elf

>On 8/12/16 7:34 PM, Ngie Cooper wrote:
>> 
>> ...
>>
>>> Log:
>>>  Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf.
>> 
>> Why?
>> 
> 
> It's a somewhat error-prone and dangerous macro. See r302908.

I'll grant you "error-prone", but why do you consider it "dangerous"? It's inefficient to walk the whole list when passing NULL as the starting pointer, but I'm not sure what the danger is.

And, if it really *is* dangerous, perhaps we should purge the TAILQ_FOREACH_FROM APIs entirely? It looks like rtld-elf was the last (in-tree) user:

    [freebsd/base/head] rpokala% grep -rl TAILQ_FOREACH_FROM .
    ./share/man/man3/Makefile
    ./share/man/man3/queue.3
    ./sys/sys/queue.h

I confirmed that queue.h just defines the (S)TAILQ_FOREACH_FROM(_SAFE) macros, but doesn't use them internally to define anything else.

-Ravi (rpokala@)

> -- 
> Regards,
> Bryan Drewery 




More information about the svn-src-all mailing list