C99 support in Samba 3

tridge at samba.org tridge at samba.org
Fri Sep 8 05:32:26 GMT 2006


 > Currently if we want the complete autogenerated files
 > for the ndr parsing from pidl, we have to support
 > C99 structure initialization.  us1 sun1 and us4 are
 > failing in the build farm right now because of this.
 > See source/librpc/gen_ndr/ndr_unixinfo.c for examples
 > (bottom of the file).

minor correction - for this to work on us4 all you need to do is add
the autoconf test to see if the machines needs the -c99 flag to
cc. See ldb on us4 in the build farm for an example of this.

The reason sun1 fails C99 tests is I don't have enough disk space on
the machine to install the upated sun studio compilers (they are a
free download). The partition /opt is on is only 123M in total, and
the compiler update needs a lot more than that. Volkers Solaris8 box
does C99 fine. It will work once I mount some more space with NFS.

On HP-UX you need the -AC99 flag to cc. See
lib/replace/libreplace_macros.m4 in Samba4 for the configure tests for

So it looks like the only problem for production use of C99 in Samba
is Solaris8 of older where the sysadmin can't update their compiler
(which is the situation I'm in at the moment).

You still might prefer not to mandate C99 structures in Samba3, but at
I thought I'd point out that there are far fewer systems that don't
have them than we orginally thought.

And maybe if you add that configure test for C99 structures for a
release, you could use the configure tests from libreplace_macros.m4,
so we get a clearer idea of the result? Otherwise we'll get false
negatives from compilers that support -c99 or -AC99 as flags.

Cheers, Tridge

More information about the samba-technical mailing list