emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why named structs and unions? C11 supports anonymous structs and uni


From: Paul Eggert
Subject: Re: Why named structs and unions? C11 supports anonymous structs and unions
Date: Sun, 11 Feb 2018 19:56:02 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Daniel Colascione wrote:

Now we get all the alignment benefits of alignas, but without the ugly "u.s." 
stuff.

That assumes C11, though. Currently Emacs assumes only C99. Although Emacs can use C11 features when 'configure' determines them to work, I don't offhand see how this could be done for this particular feature without contorting the C code even more than it's contorted now.

Instead of XCONS(c)->car, we now write XCONS(c)->u.s.car.

Normally in C code we write XCAR (c) instead of writing either form. The u.s. business is intended to be used only within a small set of source-code locations that need to know the internal structure of Lisp objects, and most C code shouldn't care whether it's '->car' or '->u.s.car'. Admittedly there are more occurrences of '->u.s.' than we'd like.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]