svn commit: samba r18030 - in branches/SAMBA_3_0/source/tdb/common: .

Stefan (metze) Metzmacher metze at samba.org
Tue Sep 5 06:01:46 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

tridge at samba.org schrieb:
> Jeremy,
> 
>  > > None at all. C++ is a superset of C.
> 
> ummm ....
> 
>  > 
>  > Except for the irritating sytactic differences we've already
>  > noticed of course :-).
> 
> which is why we're having this discussion!
> 
> Not being able to declare a structure inside a structure is to me a
> pretty significant loss of syntax.

I've done some tests:

metze at SERNOX:~/tmp> cat c++.c
struct s1_g {
                int z;
};

struct s1 {
        struct s1_g g;
        struct s1_h {
                int y;
        } h;
};

union u1 {
        struct {
                struct {
                        int in_1;
                } in;
                struct {
                        int out_1;
                } out;
        } u1_1;
        struct {
                struct {
                        int in_1;
                } in;
                struct {
                        int out_1;
                } out;
        } u1_2;
};

int main(void)
{
        struct s1 s;
        struct s1_g g;
        struct s1_h h;
        union u1 u;

        return 0;
}
metze at SERNOX:~/tmp> g++ -Wall -Wextra -o c++.o c++.c
c++.c: In function ?int main()?:
c++.c:35: error: aggregate ?s1_h h? has incomplete type and cannot be
defined
c++.c:33: warning: unused variable ?s?
c++.c:34: warning: unused variable ?g?
c++.c:35: warning: unused variable ?h?
c++.c:36: warning: unused variable ?u


So that means most of the nested structures we use can just stay,
and we would only need move the definitions of named structs out of the
nesting. And I think that would be ok.

>> As you know, it has always been my dream eventually to have Samba
>> in C++ :-). So moving closer to it is a good thing IMHO.
> 
> Do you really want to switch to C++ ??

I think we should not switch to C++!!!
But we should compile using a C++ compiler.

metze
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFE/RLKm70gjA5TCD8RAh4fAJ0WxRlaxuBKFzoEf2tsIXLhN60PWACfQCLO
DBtdw0mfYFGOcp5fuFgRyBA=
=IW+k
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list