C99 structure initialisers and Samba3
abartlet at samba.org
Tue Aug 22 21:49:43 GMT 2006
On Wed, 2006-08-23 at 07:13 +1000, tridge at samba.org wrote:
> I've been looking at what needs to be done for ldb to be used in
> Samba3. Mostly it is fairly trivial, but I have hit one snag.
> Any comments on this tradeoff? Forcing people to use gcc on older
> versions of Solaris doesn't seem too bad to me, given the advantages
> in terms of code robustness.
> Of course, we could use an #ifdef or just not compile that module in
> Samba3, so this particular snag isn't a showstopper, but it would be
> nice to be able to share code like this in future if other common code
> is cleaned up to use C99 initialisation.
This is timely, given metze's recent fix to mimir's code. Without C99
initialisers, it is *so* easy to get this wrong, with anything more than
about 2 fields in the struct.
In ldb, it's not just this module, but all modules, that use this method
to ensure code robustness when updating the modules interface (to
support new methods/requests).
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org
Samba Developer, Red Hat Inc. http://redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20060823/2c549562/attachment.bin
More information about the samba-technical