2.2.8pre2 Compiler Warnings On Digital Unix 4.0D

Boyce, Nick nick.boyce at eds.com
Tue Mar 11 13:03:07 GMT 2003


Following up my post on 4.March.2003 reporting ./configure failure on DU
4.0D for Samba 2.2.8pre2 --with-pam, I have now configured & compiled
2.2.8pre2 --with-winbind (but no PAM), and want to report the selection of
scary warnings that the Compaq C compiler throws up by default.

The following is just a representative sample (I could post the lot if
anyone really wants them) - and I have found they can *all* be eliminated by
editing source/Makefile to specify the compiler flag "-w" which reduces the
warning level from the default (thanks to Ludolf Holzheid).

I have previously reported very similar compiler warnings when building
2.2.2 on this box (October 2001), at which time I received varied advice
including (a) use GCC instead of Compaq C (Andrew Esh), (b) keep using
Compaq C because it generates better code on DU (John Malmberg), (c) reduce
the compiler's sensitivity level (Ludolf Holzheid).  I've currently followed
(b) and (c).

It occurs to me that maybe ./configure should automatically include
"CFLAGS=-O -w" in the Makefile for Digital Unix platforms (maybe Tru64 as
well - I don't have one to try) ... especially if you guys still think all
these warnings are spurious or wrong.

Here's the selection of warnings :

========================< cut >========================
cc: Warning: libsmb/clifile.c, line 57: In this statement, & before array
"data" is ignored.
		(char *)&data,  data_len, cli->max_xmit /* data, length, max
*/

cc: Warning: libsmb/smbencrypt.c, line 243: In this statement, & before
array "(unicode_passwd)" is ignored.
	ZERO_STRUCT(unicode_passwd);

cc: Warning: rpc_server/srv_samr_nt.c, line 132: In this statement, & before
array "pass[i].lm_pwd" is ignored.
		memset(&pass[i].lm_pwd, '\0', sizeof(pass[i].lm_pwd));

  [there are *lots* of the above kind of warning ... Ludolf Holzheid gave 
   a very helpful explanation of them - see refs below]

cc: Warning: rpc_server/srv_spoolss_nt.c, line 4290: In this statement, the
referenced type of the pointer value "&nullstr" is "signed char", which is
not compatible with "array [256] of signed char".
	init_unistr_array(&info->previousdrivernames, &nullstr, servername);

cc: Warning: rpc_parse/parse_spoolss.c, line 1209: In this statement, the
referenced type of the pointer value "prs_alloc_mem(...)" is "signed char",
which is not compatible with "unsigned char".
		r_u->data = prs_alloc_mem(ps, r_u->size);

cc: Warning: passdb/secrets.c, line 291: In this statement, the referenced
type of the pointer value "name" is const, but the referenced type of the
target of this assignment is not.
	ret = tdb_lock_bystring(tdb, name, timeout);

cc: Warning: tdb/tdb.c, line 119: In this statement, "(-1)" of type "long",
is being converted to "pointer to void".
		if (tdb->map_ptr == MAP_FAILED) {

cc: Warning: client/clitar.c, line 688: In this statement, the referenced
type of the pointer value "&finfo.size" is "unsigned long long", which is
not compatible with "unsigned long".
	  if (!cli_getattrE(cli, fnum, &finfo.mode, &finfo.size, NULL,
&finfo.atime, &finfo.mtime)) {

cc: Warning: nsswitch/winbind_nss.c, line 600: In this statement, the
referenced type of the pointer value "buflen" is "unsigned long", which is
not compatible with "int".
	     get_static(buffer, buflen, strlen(pw->pw_name) + 1)) == NULL) {
========================< cut >========================

I assume the compiler makes a correct decision in each case, and that my
resulting Samba binaries will work properly - and that the above just
represent slight programmer caffeine emergency moments, that someone will
tidy in due course.  Please let me know if any of the above looks like
show-stopping stuff - I can send the whole lot over if anyone wants it.

refs:
My post earlier this month on ./configure failing on DU4.0D for 2.2.8pre2
--with-pam :
http://lists.samba.org/pipermail/samba-technical/2003-March/042874.html
My post in Oct 2001 reporting compiler warnings on DU4.0D for 2.2.2 :
http://lists.samba.org/pipermail/samba-technical/2001-October/031968.html
Post from Ludolf Holzheid explaining some of the DU4.0D warnings for 2.2.2 :
http://lists.samba.org/pipermail/samba-technical/2001-October/032071.html
Post from John Malmberg stating that the Compaq C compiler is right for DU :
http://lists.samba.org/pipermail/samba-technical/2001-October/032058.html

Cheers,

Nick Boyce
EDS, Bristol, UK


More information about the samba-technical mailing list