C99 structure initialisers and Samba3

James Peach jorgar at gmail.com
Tue Aug 22 22:03:33 GMT 2006

On 23/08/06, tridge at samba.org <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.
> The problem is structure initialisers like this:
>  static const struct ldb_module_ops operational_ops = {
>          .name              = "operational",
>          .search            = operational_search,
>          .add               = operational_add,
>          .modify            = operational_modify,
>          .init_context      = operational_init
>  };
> this is a C99 style structure initialiser. We decided to start using
> these in Samba4 to reduce the incidence of coding errors due to
> incorrect structure initialisation.
> The price we paid for this is that we can't compile on older versions
> of cc on Solaris. In particular the cc used on Solaris8 and Solaris9
> doesn't support this. The one in Solaris10 seems to be fine (ie. its
> fine on SunX in the build farm). I can't see any other compilers in
> the build farm that are affacted by this. Of course, there are other
> compilers that don't support C99 structure initialisation, but in
> every other case they are also missing some other feature that Samba3
> already relies on. So it looks like its only older solaris versions
> where this makes a difference.

This also won't build on IRIX unless you have the MIPSPro 7.4
compilers. I can arrange for the IRIX box in te b uild farm to get
a compiler upgrade, but I don't know how many folks ou there
in the wild have the 7.4 version.

James Peach | jorgar at gmail.com

More information about the samba-technical mailing list