[Samba] AIX 5.2 and 3.0.3

William Jojo jojowil at hvcc.edu
Fri Apr 30 14:18:24 GMT 2004




Using IBM Visual Age C compiler version 6.

When make builds include/proto.h one proto is:

line 1322:
const struct uuid smb_uuid_unpack_static(const UUID_FLAT in);

The IBM compiler does not like this at all and warns for each source file
that includes the header:

<snip>
Compiling smbd/files.c
"include/proto.h", line 1322.19: 1506-120 (W) Function cannot return a
const qualified type.
Compiling smbd/chgpasswd.c
"include/proto.h", line 1322.19: 1506-120 (W) Function cannot return a
const qualified type.
"smbd/chgpasswd.c", line 551.35: 1506-280 (W) Function argument assignment
between types "struct passwd*" and "const struct passwd*" is not allowed.
</snip>

in addition:

<snip>
Compiling rpc_server/srv_spoolss_nt.c
"include/proto.h", line 1322.19: 1506-120 (W) Function cannot return a
const qualified type.
"rpc_server/srv_spoolss_nt.c", line 4288.51: 1506-280 (W) Function
argument assignment between types "struct uuid*" and "struct uuid_flat*"
is not allowed.
cc: 1501-230 Internal compiler error; please contact your Service
Representative
make: The error code from the last command is 40.
</snip>


which of course is super nasty :)

removing the const on proto return type seems to remedy the issue. There
also seem to be many more warnings between const-qualified and
non-const-qualified than in other 3.0.x releases and suspicious others
like the following:

Compiling lib/util_sock.c
"lib/util_sock.c", line 45.34: 1506-280 (W) Function argument assignment
between types "unsigned long*" and "int*" is not allowed.
"lib/util_sock.c", line 63.64: 1506-280 (W) Function argument assignment
between types "unsigned long*" and "int*" is not allowed.
"lib/util_sock.c", line 125.72: 1506-280 (W) Function argument assignment
between types "unsigned long*" and "int*" is not allowed.
"lib/util_sock.c", line 842.40: 1506-280 (W) Function argument assignment
between types "unsigned long*" and "int*" is not allowed.
"lib/util_sock.c", line 974.34: 1506-280 (W) Function argument assignment
between types "unsigned long*" and "int*" is not allowed.


Now I understand the IBM compiler is just trying to be strict about
certain things, and there is a potential signing issue here, but is there
a desire to have this cleaned up? I volunteer to straighten out the
argument typing if that is desired. I noticed other function prototype
return types with the const modifier, but the IBM compiler seems really
upset when it's applied to a struct.

Is the const qualifier on a return type really meaningful? I can't find
anything regarding this. Perhaps they were added to remove other warnings
when the return value was used as a function argument in nested call
evaluation?


At any rate, it's built on AIX now. :)


Bill


More information about the samba mailing list