[Mesa-dev] Use of nested functions in nouveau_array.c

İsmail Dönmez ismail at namtrac.org
Thu Dec 1 06:49:01 PST 2011


Hi;

On Thu, Dec 1, 2011 at 3:46 PM, Brian Paul <brianp at vmware.com> wrote:

> On 12/01/2011 07:36 AM, İsmail Dönmez wrote:
>
>> Hi;
>>
>> On Wed, Nov 9, 2011 at 8:08 PM, İsmail Dönmez <ismail at namtrac.org
>> <mailto:ismail at namtrac.org>> wrote:
>>
>>    Another thing to notice that nested functions require executable
>>    stack. This is also another reason to get rid of them.
>>
>>    On Wed, Nov 9, 2011 at 3:11 PM, İsmail Dönmez <ismail at namtrac.org
>>    <mailto:ismail at namtrac.org>> wrote:
>>
>>        Hi;
>>
>>        nouveau_array.c seems to be using nested functions which is
>>        not supported by clang (or the EDG based compilers it seems),
>>        the reduced testcase looks like this:
>>
>>        foo()
>>        {
>>             auto void f();
>>             void f() {};
>>        }
>>
>>        I talked to the clang developers and they don't plan to
>>        support this GNU extension since (they say) it would be too
>>        hard to support it in the parser. Clang website notes the
>>        following about this issue (from
>>        http://clang.llvm.org/docs/**UsersManual.html#c_unimpl_gcc<http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc>)
>>
>>        <quote>
>>        clang does not support nested functions; this is a complex
>>        feature which is infrequently used, so it is unlikely to be
>>        implemented anytime soon.
>>        </quote>
>>
>>        Is there any chance of removing such code from Mesa?
>>
>>
>> Would be nice to get a comment on this.
>>
>
> I imagine you're the first person to try to compile that driver with clang
> because nobody else has mentioned this before.
>
> I don't think anyone would object to the code being rewritten to avoid
> nested functions.  Is that something that you could do?


I imagined I had to the real work ;) I'll see what I can do.

Regards,
ismail


>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111201/0fdc0c95/attachment.htm>


More information about the mesa-dev mailing list