Bug 706 - significant number of warnings from compiler on Solaris X86
significant number of warnings from compiler on Solaris X86
Status: RESOLVED LATER
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.0
All Solaris
: P3 minor
: none
Assigned To: Tim Potter
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-31 21:48 UTC by Carl Erhorn
Modified: 2005-11-14 09:30 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Erhorn 2003-10-31 21:48:08 UTC
I have just built Samba 3.0.0 from source, on Solaris 8 X86, using the most
recent Sun C compiler (version 8, from the Sun ONE compiler collection). Both
the compiler and operating system are patched up to date as of October 31, 2003. 

While the product appears to build cleanly, there are a significant number of
warnings and non-fatal errors that should be cleaned up to insure proper
operation under all possible conditions. I will attach the text from the build
process below, so that you can see the actual warnings in context. I am
concerned mostly about things like 'initializer out of range', or 'return type
mismatch', not the more common warning about signed/unsigned mismatches,
although those could also be of concern when they are not referring to character
types. 

My point is that with some very minor changes, Samba 3.0.0 source could build
completely clean on Solaris, which I think would be a desirable goal. 

Note also that while these warnings occurred on Solaris 8 for Intel, the
compiler is basically the same as the Sparc version, which means that the Sparc
platform most likely has exactly the same warnings when built with the Sun ONE
compilers. Cleaning up these warnings and protential errors will also clean the
Sparc platform, and perhaps many others as well. 

There are a few warnings that may be quite serious, such as the one about the
improper integer/pointer use in sendfile.c, the return type mismatches in 
util_str.c, the 'initializer does not fit' in util_str.c, the missing prototype 
for 'setenv' in wb_common.c, the 'initializer does not fit' in printing.c, the 
missing prototype for 'crypt' in pass_check.c, the series of 'initializer does
not fit' errors in popt_common.c, and the argument mismatches in client.c. 

The 'initializer does not fit' error in pdbedit.c, the char/int mismatch in 
profiles.c, the missing 'setenv' prototype in nsswitch/wb_common.c, the 
pointer/int mismatch in lib/sendfile.c, the return value mismatches and the 
'initializer does not fit' in lib/util_str.c, and the 'initializer does not fit'
in lib/util.c, the missing prototype for 'smbc_remove_unused_server' in 
libsmb/libsmb_cache.c, and the end_of_loop code not reached error in 
modules/vfs_netatalk.c are also of the same level of concern. 

These could all be real errors, causing improper behavior under certain 
conditions. I have not been able to do any significant testing yet, so I don't
know if these problems could cause a crash, or corrupted data. But the types of 
warnings these problems generated are non-trivial, and are potentially serious.
The remainder of the warnings are trivial, and are only generated because the
Sun compilers are fairly strict about syntax, perhaps much more so than the GNU
compilers. 

Still, it would be very nice to have them all eliminated in the next release, if
that is at all possible. Thanks to the team for their outstanding improvements
in this newer version of the code. 

Sincerely - cperhorn@yahoo.com

--------------------------------------------------------------------------------
Using FLAGS =  -O -xchip=pentium_pro -xarch=pentium_pro -xtarget=pentium_pro \
               -I./popt -Iinclude
-I/export/system/sources/samba-3.0.0/source/include \
               -I/export/system/sources/samba-3.0.0/source/ubiqx \
               -I/export/system/sources/samba-3.0.0/source/smbwrapper  -I. \
               -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
               -I/export/system/sources/samba-3.0.0/source

      LIBS = -lsendfile -lsec -lgen -lresolv -lsocket -lnsl -ldl

      LDSHFLAGS = -G -O -xchip=pentium_pro -xarch=pentium_pro
-xtarget=pentium_pro  -R/usr/lib

      LDFLAGS = -R/usr/lib

Generating smbd/build_options.c
Building include/proto.h
creating /export/system/sources/samba-3.0.0/source/include/proto.h
Building include/wrepld_proto.h
creating /export/system/sources/samba-3.0.0/source/include/wrepld_proto.h
Building include/build_env.h
creating /export/system/sources/samba-3.0.0/source/nsswitch/winbindd_proto.h
creating /export/system/sources/samba-3.0.0/source/web/swat_proto.h
creating /export/system/sources/samba-3.0.0/source/client/client_proto.h
creating /export/system/sources/samba-3.0.0/source/utils/net_proto.h
Compiling dynconfig.c
Compiling param/loadparm.c
Compiling param/params.c
Compiling smbd/files.c
Compiling smbd/chgpasswd.c
Compiling smbd/connection.c
Compiling smbd/utmp.c
Compiling smbd/session.c
Compiling smbd/dfree.c
Compiling smbd/dir.c
Compiling smbd/password.c
Compiling smbd/conn.c
Compiling smbd/fileio.c
Compiling smbd/ipc.c
Compiling smbd/lanman.c
Compiling smbd/negprot.c
Compiling smbd/message.c
Compiling smbd/nttrans.c
Compiling smbd/pipes.c
Compiling smbd/reply.c
"smbd/reply.c", line 1484: warning: assignment type mismatch:
        pointer to unsigned char "=" pointer to char
"smbd/reply.c", line 1809: warning: assignment type mismatch:
        pointer to unsigned char "=" pointer to char
Compiling smbd/sesssetup.c
Compiling smbd/trans2.c
Compiling smbd/uid.c
Compiling smbd/dosmode.c
Compiling smbd/filename.c
Compiling smbd/open.c
Compiling smbd/close.c
Compiling smbd/blocking.c
Compiling smbd/sec_ctx.c
Compiling smbd/srvstr.c
Compiling smbd/vfs.c
Compiling smbd/vfs-wrap.c
Compiling smbd/statcache.c
Compiling smbd/posix_acls.c
Compiling lib/sysacls.c
Compiling lib/server_mutex.c
Compiling smbd/process.c
Compiling smbd/service.c
Compiling smbd/error.c
Compiling printing/printfsp.c
Compiling lib/util_seaccess.c
Compiling lib/sysquotas.c
Compiling smbd/change_trust_pw.c
Compiling smbd/fake_file.c
Compiling smbd/quotas.c
Compiling smbd/ntquotas.c
Compiling lib/afs.c
Compiling smbd/mangle.c
Compiling smbd/mangle_hash.c
Compiling smbd/mangle_map.c
Compiling smbd/mangle_hash2.c
Compiling msdfs/msdfs.c
Compiling libsmb/clientgen.c
Compiling libsmb/cliconnect.c
Compiling libsmb/clifile.c
Compiling libsmb/clikrb5.c
Compiling libsmb/clispnego.c
"libsmb/clispnego.c", line 338: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to const unsigned char : "libsmb/clispnego.c", line
264
        argument : pointer to char
Compiling libsmb/asn1.c
Compiling libsmb/clirap.c
Compiling libsmb/clierror.c
Compiling libsmb/climessage.c
Compiling libsmb/clireadwrite.c
Compiling libsmb/clilist.c
Compiling libsmb/cliprint.c
Compiling libsmb/clitrans.c
Compiling libsmb/clisecdesc.c
Compiling libsmb/clidgram.c
Compiling libsmb/clistr.c
Compiling libsmb/cliquota.c
Compiling libsmb/clifsinfo.c
Compiling libsmb/smberr.c
Compiling libsmb/credentials.c
Compiling libsmb/pwd_cache.c
Compiling libsmb/clioplock.c
Compiling libsmb/errormap.c
Compiling libsmb/clirap2.c
Compiling libsmb/passchange.c
Compiling libsmb/doserr.c
Compiling rpc_parse/parse_prs.c
Compiling rpc_parse/parse_sec.c
Compiling rpc_parse/parse_misc.c
Compiling libsmb/nterr.c
Compiling libsmb/smbdes.c
Compiling libsmb/smbencrypt.c
Compiling libsmb/ntlmssp.c
Compiling libsmb/ntlmssp_parse.c
Compiling libsmb/ntlmssp_sign.c
Compiling libsmb/unexpected.c
Compiling libsmb/namecache.c
Compiling libsmb/nmblib.c
Compiling libsmb/namequery.c
Compiling libsmb/conncache.c
Compiling rpc_server/srv_lsa.c
Compiling rpc_server/srv_lsa_nt.c
Compiling rpc_server/srv_reg.c
Compiling rpc_server/srv_reg_nt.c
Compiling rpc_server/srv_lsa_ds.c
Compiling rpc_server/srv_lsa_ds_nt.c
Compiling rpc_server/srv_wkssvc.c
Compiling rpc_server/srv_wkssvc_nt.c
Compiling rpc_server/srv_netlog.c
Compiling rpc_server/srv_netlog_nt.c
Compiling rpc_server/srv_dfs.c
Compiling rpc_server/srv_dfs_nt.c
Compiling rpc_server/srv_srvsvc.c
Compiling rpc_server/srv_srvsvc_nt.c
Compiling rpc_server/srv_spoolss.c
Compiling rpc_server/srv_spoolss_nt.c
Compiling rpc_server/srv_samr.c
Compiling rpc_server/srv_samr_nt.c
Compiling rpc_server/srv_samr_util.c
Compiling rpc_server/srv_pipe_hnd.c
Compiling rpc_server/srv_util.c
Compiling rpc_server/srv_pipe.c
Compiling rpc_server/srv_lsa_hnd.c
Compiling rpc_parse/parse_lsa.c
Compiling rpc_parse/parse_net.c
Compiling rpc_parse/parse_reg.c
Compiling rpc_parse/parse_rpc.c
Compiling rpc_parse/parse_samr.c
Compiling rpc_parse/parse_srv.c
Compiling rpc_parse/parse_wks.c
Compiling rpc_parse/parse_ds.c
Compiling rpc_parse/parse_spoolss.c
Compiling rpc_parse/parse_dfs.c
Compiling rpc_parse/parse_echo.c
Compiling registry/reg_objects.c
Compiling passdb/secrets.c
Compiling locking/locking.c
Compiling locking/brlock.c
Compiling locking/posix.c
Compiling passdb/pdb_get_set.c
Compiling passdb/passdb.c
Compiling passdb/pdb_interface.c
Compiling passdb/machine_sid.c
Compiling passdb/util_sam_sid.c
Compiling passdb/pdb_compat.c
Compiling passdb/privileges.c
Compiling passdb/lookup_sid.c
Compiling passdb/pdb_smbpasswd.c
Compiling passdb/pdb_tdb.c
Compiling passdb/pdb_guest.c
Compiling printing/pcap.c
Compiling printing/print_svid.c
Compiling printing/print_cups.c
Compiling printing/print_generic.c
Compiling printing/lpq_parse.c
Compiling printing/load.c
Compiling profile/profile.c
Compiling lib/version.c
Compiling lib/charcnv.c
Compiling lib/debug.c
Compiling lib/fault.c
Compiling lib/getsmbpass.c
Compiling lib/interface.c
Compiling lib/md4.c
Compiling lib/interfaces.c
Compiling lib/pidfile.c
Compiling lib/replace.c
Compiling lib/replace1.c
Compiling lib/signal.c
Compiling lib/system.c
Compiling lib/sendfile.c
"lib/sendfile.c", line 164: warning: improper pointer/integer combination: op
"="
Compiling lib/time.c
Compiling lib/ufc.c
Compiling lib/genrand.c
Compiling lib/username.c
Compiling lib/util_getent.c
Compiling lib/util_pw.c
Compiling lib/access.c
Compiling lib/smbrun.c
Compiling lib/bitmap.c
Compiling lib/crc32.c
Compiling lib/snprintf.c
Compiling lib/dprintf.c
Compiling lib/xfile.c
Compiling lib/wins_srv.c
Compiling lib/util_str.c
"lib/util_str.c", line 389: warning: argument #3 is incompatible with prototype:
        prototype: pointer to const char : "include/proto.h", line 245
        argument : pointer to unsigned char
"lib/util_str.c", line 391: warning: argument #2 is incompatible with prototype:
        prototype: pointer to char : "include/proto.h", line 251
        argument : pointer to unsigned char
"lib/util_str.c", line 1196: warning: return value type mismatch
"lib/util_str.c", line 1244: warning: return value type mismatch
"lib/util_str.c", line 1910: warning: initializer does not fit or is out of
range: -1
Compiling lib/clobber.c
Compiling lib/util_sid.c
Compiling lib/util_uuid.c
Compiling lib/util_unistr.c
Compiling lib/util_file.c
Compiling lib/data_blob.c
Compiling lib/util.c
"lib/util.c", line 59: warning: initializer does not fit or is out of range: -1
Compiling lib/util_sock.c
Compiling lib/sock_exec.c
Compiling lib/util_sec.c
Compiling lib/talloc.c
Compiling lib/hash.c
Compiling lib/substitute.c
Compiling lib/fsusage.c
Compiling lib/ms_fnmatch.c
Compiling lib/select.c
Compiling lib/messages.c
Compiling lib/tallocmsg.c
Compiling lib/dmallocmsg.c
Compiling libsmb/smb_signing.c
Compiling lib/md5.c
Compiling lib/hmacmd5.c
Compiling lib/iconv.c
Compiling lib/smbpasswd.c
Compiling nsswitch/wb_client.c
Compiling nsswitch/wb_common.c
"nsswitch/wb_common.c", line 481: warning: implicit function declaration: setenv
Compiling lib/pam_errors.c
Compiling intl/lang_tdb.c
Compiling lib/account_pol.c
Compiling lib/adt_tree.c
Compiling lib/gencache.c
Compiling tdb/tdb.c
Compiling tdb/spinlock.c
Compiling tdb/tdbutil.c
"tdb/tdbutil.c", line 45: warning: assignment type mismatch:
        pointer to char "=" pointer to const char
"tdb/tdbutil.c", line 59: warning: argument #1 is incompatible with prototype:
        prototype: pointer to int : "include/../tdb/tdb.h", line 130
        argument : pointer to volatile int
Compiling tdb/tdbback.c
Compiling lib/module.c
Compiling lib/ldap_escape.c
Compiling printing/printing.c
"printing/printing.c", line 399: warning: initializer does not fit or is out of
range: -1
Compiling printing/nt_printing.c
Compiling printing/notify.c
Compiling printing/printing_db.c
Compiling smbd/oplock.c
Compiling smbd/oplock_irix.c
Compiling smbd/oplock_linux.c
Compiling smbd/notify.c
Compiling smbd/notify_hash.c
"smbd/notify_hash.c", line 91: warning: assignment type mismatch:
        pointer to char "=" pointer to const char
Compiling smbd/notify_kernel.c
Compiling groupdb/mapping.c
Compiling auth/auth.c
Compiling auth/auth_rhosts.c
Compiling auth/auth_sam.c
Compiling auth/auth_unix.c
Compiling auth/auth_winbind.c
Compiling auth/auth_server.c
Compiling auth/auth_domain.c
Compiling auth/auth_builtin.c
Compiling auth/auth_util.c
Compiling auth/auth_compat.c
Compiling auth/auth_ntlmssp.c
Compiling auth/pampass.c
Compiling auth/pass_check.c
"auth/pass_check.c", line 574: warning: implicit function declaration: crypt
Compiling libsmb/samlogon_cache.c
Compiling libsmb/namequery_dc.c
Compiling libsmb/trustdom_cache.c
Compiling libsmb/trusts_util.c
Compiling rpc_client/cli_lsarpc.c
Compiling rpc_client/cli_samr.c
Compiling rpc_client/cli_netlogon.c
Compiling rpc_client/cli_srvsvc.c
Compiling rpc_client/cli_wkssvc.c
Compiling rpc_client/cli_dfs.c
Compiling rpc_client/cli_reg.c
Compiling rpc_client/cli_pipe.c
Compiling rpc_client/cli_spoolss.c
Compiling rpc_client/cli_spoolss_notify.c
Compiling rpc_client/cli_ds.c
Compiling rpc_client/cli_echo.c
Compiling libads/ldap.c
Compiling libads/ldap_printer.c
Compiling libads/sasl.c
Compiling libads/krb5_setpw.c
Compiling libads/ldap_user.c
Compiling libads/ads_struct.c
Compiling libads/ads_status.c
Compiling libads/disp_sec.c
Compiling libads/ads_utils.c
Compiling libads/ldap_utils.c
Compiling libads/ads_ldap.c
Compiling libads/authdata.c
Compiling libads/kerberos.c
Compiling libads/util.c
Compiling libads/kerberos_verify.c
Compiling lib/system_smbd.c
Compiling lib/util_smbd.c
Compiling registry/reg_frontend.c
Compiling registry/reg_cachehook.c
Compiling registry/reg_printing.c
Compiling registry/reg_db.c
Compiling lib/popt_common.c
"lib/popt_common.c", line 116: warning: initialization type mismatch
"lib/popt_common.c", line 127: warning: initializer does not fit or is out of
range: 0x80000005
"lib/popt_common.c", line 127: warning: initialization type mismatch
"lib/popt_common.c", line 136: warning: initialization type mismatch
"lib/popt_common.c", line 384: warning: initializer does not fit or is out of
range: 0x80000005
"lib/popt_common.c", line 384: warning: initialization type mismatch
Compiling ubiqx/ubi_BinTree.c
Compiling ubiqx/ubi_Cache.c
Compiling ubiqx/ubi_SplayTree.c
Compiling ubiqx/ubi_dLinkList.c
Compiling ubiqx/ubi_sLinkList.c
Compiling smbd/build_options.c
Compiling smbd/server.c
Compiling popt/findme.c
Compiling popt/popt.c
Compiling popt/poptconfig.c
Compiling popt/popthelp.c
Compiling popt/poptparse.c
Linking bin/smbd
Compiling nmbd/asyncdns.c
Compiling nmbd/nmbd.c
Compiling nmbd/nmbd_become_dmb.c
Compiling nmbd/nmbd_become_lmb.c
Compiling nmbd/nmbd_browserdb.c
Compiling nmbd/nmbd_browsesync.c
Compiling nmbd/nmbd_elections.c
Compiling nmbd/nmbd_incomingdgrams.c
Compiling nmbd/nmbd_incomingrequests.c
Compiling nmbd/nmbd_lmhosts.c
Compiling nmbd/nmbd_logonnames.c
Compiling nmbd/nmbd_mynames.c
Compiling nmbd/nmbd_namelistdb.c
Compiling nmbd/nmbd_namequery.c
Compiling nmbd/nmbd_nameregister.c
Compiling nmbd/nmbd_namerelease.c
Compiling nmbd/nmbd_nodestatus.c
Compiling nmbd/nmbd_packets.c
Compiling nmbd/nmbd_processlogon.c
Compiling nmbd/nmbd_responserecordsdb.c
Compiling nmbd/nmbd_sendannounce.c
Compiling nmbd/nmbd_serverlistdb.c
Compiling nmbd/nmbd_subnetdb.c
Compiling nmbd/nmbd_winsproxy.c
Compiling nmbd/nmbd_winsserver.c
Compiling nmbd/nmbd_workgroupdb.c
Compiling nmbd/nmbd_synclists.c
Linking bin/nmbd
Compiling web/cgi.c
Compiling web/diagnose.c
Compiling web/startstop.c
Compiling web/statuspage.c
Compiling web/swat.c
Compiling web/neg_lang.c
Compiling lib/dummyroot.c
Linking bin/swat
Compiling nsswitch/winbindd.c
Compiling nsswitch/winbindd_user.c
Compiling nsswitch/winbindd_group.c
Compiling nsswitch/winbindd_util.c
Compiling nsswitch/winbindd_cache.c
Compiling nsswitch/winbindd_pam.c
Compiling nsswitch/winbindd_sid.c
Compiling nsswitch/winbindd_misc.c
Compiling nsswitch/winbindd_cm.c
Compiling nsswitch/winbindd_wins.c
Compiling nsswitch/winbindd_rpc.c
Compiling nsswitch/winbindd_ads.c
Compiling nsswitch/winbindd_dual.c
Compiling nsswitch/winbindd_acct.c
"nsswitch/winbindd_acct.c", line 224: warning: argument #1 is incompatible with
prototype:
        prototype: pointer to pointer to const char : "include/proto.h", line
1068
        argument : pointer to pointer to char
Compiling sam/idmap.c
Compiling sam/idmap_util.c
Compiling sam/idmap_tdb.c
Linking bin/winbindd
Compiling client/client.c
"client/client.c", line 694: warning: argument #4 is incompatible with
prototype:
        prototype: pointer to unsigned long long : "include/proto.h", line 1550
        argument : pointer to unsigned int
"client/client.c", line 1070: warning: argument #4 is incompatible with
prototype:
        prototype: pointer to unsigned long long : "include/proto.h", line 1550
        argument : pointer to unsigned int
"client/client.c", line 2670: warning: argument #1 is incompatible with
prototype:
        prototype: pointer to char : "client/client.c", line 2039
        argument : pointer to const char
"client/client.c", line 2939: warning: argument #1 is incompatible with
prototype:
        prototype: pointer to char : "include/proto.h", line 2825
        argument : pointer to const char
Compiling client/clitar.c
Compiling lib/readline.c
Linking bin/smbclient
Compiling utils/net.c
Compiling utils/net_ads.c
Compiling utils/net_ads_cldap.c
Compiling utils/net_help.c
Compiling utils/net_rap.c
Compiling utils/net_rpc.c
Compiling utils/net_rpc_samsync.c
Compiling utils/net_rpc_join.c
Compiling utils/net_time.c
Compiling utils/net_lookup.c
Compiling utils/net_cache.c
Compiling utils/net_groupmap.c
Compiling utils/net_idmap.c
Linking bin/net
Compiling client/smbspool.c
Linking bin/smbspool
Compiling utils/testparm.c
Linking bin/testparm
Compiling utils/testprns.c
Linking bin/testprns
Compiling utils/status.c
Linking bin/smbstatus
Compiling utils/smbcontrol.c
"utils/smbcontrol.c", line 422: warning: argument #3 is incompatible with
prototype:
        prototype: pointer to char : "include/proto.h", line 3101
        argument : pointer to const char
Linking bin/smbcontrol
Compiling utils/smbtree.c
Linking bin/smbtree
Compiling tdb/tdbbackup.c
Linking bin/tdbbackup
Compiling utils/nmblookup.c
Linking bin/nmblookup
Compiling utils/pdbedit.c
"utils/pdbedit.c", line 271: warning: initializer does not fit or is out of
range: -1544
Linking bin/pdbedit
Compiling utils/smbpasswd.c
Linking bin/smbpasswd
Compiling rpcclient/rpcclient.c
Compiling rpcclient/cmd_lsarpc.c
Compiling rpcclient/cmd_samr.c
Compiling rpcclient/cmd_spoolss.c
"rpcclient/cmd_spoolss.c", line 452: warning: argument #6 is incompatible with
prototype:
        prototype: pointer to unsigned int : "include/proto.h", line 3545
        argument : pointer to int
"rpcclient/cmd_spoolss.c", line 456: warning: argument #6 is incompatible with
prototype:
        prototype: pointer to unsigned int : "include/proto.h", line 3545
        argument : pointer to int
"rpcclient/cmd_spoolss.c", line 1185: warning: argument #1 is incompatible with
prototype:
        prototype: pointer to char : "/usr/include/iso/string_iso.h", line 75
        argument : pointer to const char
Compiling rpcclient/cmd_netlogon.c
Compiling rpcclient/cmd_srvsvc.c
Compiling rpcclient/cmd_dfs.c
Compiling rpcclient/cmd_reg.c
"rpcclient/cmd_reg.c", line 910: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to const pointer to char : "/usr/include/stdio.h",
line 265
        argument : pointer to pointer to const char
Compiling rpcclient/display_sec.c
Compiling rpcclient/cmd_ds.c
Compiling rpcclient/cmd_echo.c
Linking bin/rpcclient
Compiling utils/smbcacls.c
Linking bin/smbcacls
Compiling utils/profiles.c
"utils/profiles.c", line 426: warning: argument #1 is incompatible with
prototype:
        prototype: pointer to const char : "/usr/include/iso/string_iso.h", line
72
        argument : pointer to const unsigned char
"utils/profiles.c", line 439: warning: argument #1 is incompatible with
prototype:
        prototype: pointer to const char : "/usr/include/iso/stdio_iso.h", line
185
        argument : pointer to const unsigned char
"utils/profiles.c", line 451: warning: argument #1 is incompatible with
prototype:
        prototype: pointer to const char : "/usr/include/iso/string_iso.h", line
113
        argument : pointer to const unsigned char
"utils/profiles.c", line 454: warning: statement not reached
"utils/profiles.c", line 558: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to const unsigned char : "utils/profiles.c", line 421
        argument : pointer to const char
"utils/profiles.c", line 567: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to const unsigned char : "utils/profiles.c", line 421
        argument : pointer to const char
"utils/profiles.c", line 613: warning: argument #1 is incompatible with
prototype:
        prototype: pointer to char : "/usr/include/sys/mman.h", line 153
        argument : pointer to int
Linking bin/profiles
Compiling utils/ntlm_auth.c
Compiling libsmb/spnego.c
"libsmb/spnego.c", line 51: warning: argument #2 is incompatible with prototype:
        prototype: pointer to pointer to char : "include/proto.h", line 1429
        argument : pointer to pointer to const char
"libsmb/spnego.c", line 186: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to pointer to char : "include/proto.h", line 1429
        argument : pointer to pointer to const char
"libsmb/spnego.c", line 321: warning: argument #1 is incompatible with
prototype:
        prototype: pointer to void : "/usr/include/iso/stdlib_iso.h", line 101
        argument : pointer to const char
"libsmb/spnego.c", line 330: warning: argument #1 is incompatible with
prototype:
        prototype: pointer to void : "/usr/include/iso/stdlib_iso.h", line 101
        argument : pointer to const char
Linking bin/ntlm_auth
Compiling utils/smbcquotas.c
Linking bin/smbcquotas
Compiling nsswitch/wbinfo.c
Linking bin/wbinfo
Compiling nsswitch/wb_common.c with -KPIC
"nsswitch/wb_common.c", line 481: warning: implicit function declaration: setenv
Compiling lib/replace1.c with -KPIC
Compiling nsswitch/winbind_nss_solaris.c with -KPIC
Compiling nsswitch/winbind_nss_linux.c with -KPIC
"nsswitch/winbind_nss_linux.c", line 112: warning: argument #2 is incompatible
with prototype:
        prototype: pointer to int : "nsswitch/winbind_nss_linux.c", line 41
        argument : pointer to unsigned int
"nsswitch/winbind_nss_linux.c", line 124: warning: argument #2 is incompatible
with prototype:
        prototype: pointer to int : "nsswitch/winbind_nss_linux.c", line 41
        argument : pointer to unsigned int
"nsswitch/winbind_nss_linux.c", line 141: warning: argument #2 is incompatible
with prototype:
        prototype: pointer to int : "nsswitch/winbind_nss_linux.c", line 41
        argument : pointer to unsigned int
"nsswitch/winbind_nss_linux.c", line 153: warning: argument #2 is incompatible
with prototype:
        prototype: pointer to int : "nsswitch/winbind_nss_linux.c", line 41
        argument : pointer to unsigned int
"nsswitch/winbind_nss_linux.c", line 165: warning: argument #2 is incompatible
with prototype:
        prototype: pointer to int : "nsswitch/winbind_nss_linux.c", line 41
        argument : pointer to unsigned int
"nsswitch/winbind_nss_linux.c", line 202: warning: argument #2 is incompatible
with prototype:
        prototype: pointer to int : "nsswitch/winbind_nss_linux.c", line 41
        argument : pointer to unsigned int
"nsswitch/winbind_nss_linux.c", line 214: warning: argument #2 is incompatible
with prototype:
        prototype: pointer to int : "nsswitch/winbind_nss_linux.c", line 41
        argument : pointer to unsigned int
"nsswitch/winbind_nss_linux.c", line 240: warning: argument #2 is incompatible
with prototype:
        prototype: pointer to int : "nsswitch/winbind_nss_linux.c", line 41
        argument : pointer to unsigned int
"nsswitch/winbind_nss_linux.c", line 265: warning: argument #2 is incompatible
with prototype:
        prototype: pointer to int : "nsswitch/winbind_nss_linux.c", line 41
        argument : pointer to unsigned int
Compiling lib/snprintf.c with -KPIC
Linking nsswitch/libnss_winbind.so
Compiling nsswitch/wins.c with -KPIC
"nsswitch/wins.c", line 315: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to int : "nsswitch/wins.c", line 268
        argument : pointer to unsigned int
"nsswitch/wins.c", line 325: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to int : "nsswitch/wins.c", line 268
        argument : pointer to unsigned int
"nsswitch/wins.c", line 329: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to int : "nsswitch/wins.c", line 268
        argument : pointer to unsigned int
"nsswitch/wins.c", line 334: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to int : "nsswitch/wins.c", line 268
        argument : pointer to unsigned int
"nsswitch/wins.c", line 354: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to int : "nsswitch/wins.c", line 268
        argument : pointer to unsigned int
"nsswitch/wins.c", line 358: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to int : "nsswitch/wins.c", line 268
        argument : pointer to unsigned int
Compiling dynconfig.c with -KPIC
Compiling param/loadparm.c with -KPIC
Compiling param/params.c with -KPIC
Compiling ubiqx/ubi_BinTree.c with -KPIC
Compiling ubiqx/ubi_Cache.c with -KPIC
Compiling ubiqx/ubi_SplayTree.c with -KPIC
Compiling ubiqx/ubi_dLinkList.c with -KPIC
Compiling ubiqx/ubi_sLinkList.c with -KPIC
Compiling libsmb/clientgen.c with -KPIC
Compiling libsmb/cliconnect.c with -KPIC
Compiling libsmb/clifile.c with -KPIC
Compiling libsmb/clikrb5.c with -KPIC
Compiling libsmb/clispnego.c with -KPIC
"libsmb/clispnego.c", line 338: warning: argument #2 is incompatible with
prototype:
        prototype: pointer to const unsigned char : "libsmb/clispnego.c", line
264
        argument : pointer to char
Compiling libsmb/asn1.c with -KPIC
Compiling libsmb/clirap.c with -KPIC
Compiling libsmb/clierror.c with -KPIC
Compiling libsmb/climessage.c with -KPIC
Compiling libsmb/clireadwrite.c with -KPIC
Compiling libsmb/clilist.c with -KPIC
Compiling libsmb/cliprint.c with -KPIC
Compiling libsmb/clitrans.c with -KPIC
Compiling libsmb/clisecdesc.c with -KPIC
Compiling libsmb/clidgram.c with -KPIC
Compiling libsmb/clistr.c with -KPIC
Compiling libsmb/cliquota.c with -KPIC
Compiling libsmb/clifsinfo.c with -KPIC
Compiling libsmb/smberr.c with -KPIC
Compiling libsmb/credentials.c with -KPIC
Compiling libsmb/pwd_cache.c with -KPIC
Compiling libsmb/clioplock.c with -KPIC
Compiling libsmb/errormap.c with -KPIC
Compiling libsmb/clirap2.c with -KPIC
Compiling libsmb/passchange.c with -KPIC
Compiling libsmb/doserr.c with -KPIC
Compiling rpc_parse/parse_prs.c with -KPIC
Compiling rpc_parse/parse_sec.c with -KPIC
Compiling rpc_parse/parse_misc.c with -KPIC
Compiling libsmb/nterr.c with -KPIC
Compiling libsmb/smbdes.c with -KPIC
Compiling libsmb/smbencrypt.c with -KPIC
Compiling libsmb/ntlmssp.c with -KPIC
Compiling libsmb/ntlmssp_parse.c with -KPIC
Compiling libsmb/ntlmssp_sign.c with -KPIC
Compiling libsmb/unexpected.c with -KPIC
Compiling libsmb/namecache.c with -KPIC
Compiling libsmb/nmblib.c with -KPIC
Compiling libsmb/namequery.c with -KPIC
Compiling libsmb/conncache.c with -KPIC
Compiling lib/version.c with -KPIC
Compiling lib/charcnv.c with -KPIC
Compiling lib/debug.c with -KPIC
Compiling lib/fault.c with -KPIC
Compiling lib/getsmbpass.c with -KPIC
Compiling lib/interface.c with -KPIC
Compiling lib/md4.c with -KPIC
Compiling lib/interfaces.c with -KPIC
Compiling lib/pidfile.c with -KPIC
Compiling lib/replace.c with -KPIC
Compiling lib/signal.c with -KPIC
Compiling lib/system.c with -KPIC
Compiling lib/sendfile.c with -KPIC
"lib/sendfile.c", line 164: warning: improper pointer/integer combination: op
"="
Compiling lib/time.c with -KPIC
Compiling lib/ufc.c with -KPIC
Compiling lib/genrand.c with -KPIC
Compiling lib/username.c with -KPIC
Compiling lib/util_getent.c with -KPIC
Compiling lib/util_pw.c with -KPIC
Compiling lib/access.c with -KPIC
Compiling lib/smbrun.c with -KPIC
Compiling lib/bitmap.c with -KPIC
Compiling lib/crc32.c with -KPIC
Compiling lib/dprintf.c with -KPIC
Compiling lib/xfile.c with -KPIC
Compiling lib/wins_srv.c with -KPIC
Compiling lib/util_str.c with -KPIC
"lib/util_str.c", line 389: warning: argument #3 is incompatible with prototype:
        prototype: pointer to const char : "include/proto.h", line 245
        argument : pointer to unsigned char
"lib/util_str.c", line 391: warning: argument #2 is incompatible with prototype:
        prototype: pointer to char : "include/proto.h", line 251
        argument : pointer to unsigned char
"lib/util_str.c", line 1196: warning: return value type mismatch
"lib/util_str.c", line 1244: warning: return value type mismatch
"lib/util_str.c", line 1910: warning: initializer does not fit or is out of
range: -1
Compiling lib/clobber.c with -KPIC
Compiling lib/util_sid.c with -KPIC
Compiling lib/util_uuid.c with -KPIC
Compiling lib/util_unistr.c with -KPIC
Compiling lib/util_file.c with -KPIC
Compiling lib/data_blob.c with -KPIC
Compiling lib/util.c with -KPIC
"lib/util.c", line 59: warning: initializer does not fit or is out of range: -1
Compiling lib/util_sock.c with -KPIC
Compiling lib/sock_exec.c with -KPIC
Compiling lib/util_sec.c with -KPIC
Compiling lib/talloc.c with -KPIC
Compiling lib/hash.c with -KPIC
Compiling lib/substitute.c with -KPIC
Compiling lib/fsusage.c with -KPIC
Compiling lib/ms_fnmatch.c with -KPIC
Compiling lib/select.c with -KPIC
Compiling lib/messages.c with -KPIC
Compiling lib/tallocmsg.c with -KPIC
Compiling lib/dmallocmsg.c with -KPIC
Compiling libsmb/smb_signing.c with -KPIC
Compiling lib/md5.c with -KPIC
Compiling lib/hmacmd5.c with -KPIC
Compiling lib/iconv.c with -KPIC
Compiling lib/smbpasswd.c with -KPIC
Compiling nsswitch/wb_client.c with -KPIC
Compiling lib/pam_errors.c with -KPIC
Compiling intl/lang_tdb.c with -KPIC
Compiling lib/account_pol.c with -KPIC
Compiling lib/adt_tree.c with -KPIC
Compiling lib/gencache.c with -KPIC
Compiling tdb/tdb.c with -KPIC
Compiling tdb/spinlock.c with -KPIC
Compiling tdb/tdbutil.c with -KPIC
"tdb/tdbutil.c", line 45: warning: assignment type mismatch:
        pointer to char "=" pointer to const char
"tdb/tdbutil.c", line 59: warning: argument #1 is incompatible with prototype:
        prototype: pointer to int : "include/../tdb/tdb.h", line 130
        argument : pointer to volatile int
Compiling tdb/tdbback.c with -KPIC
Compiling lib/module.c with -KPIC
Compiling lib/ldap_escape.c with -KPIC
Compiling libads/kerberos.c with -KPIC
Linking nsswitch/libnss_wins.so
Compiling libsmb/libsmbclient.c with -KPIC
Compiling libsmb/libsmb_compat.c with -KPIC
Compiling libsmb/libsmb_cache.c with -KPIC
"libsmb/libsmb_cache.c", line 166: warning: implicit function declaration:
smbc_remove_unused_server
Linking libsmbclient non-shared library bin/libsmbclient.a
Linking libsmbclient shared library bin/libsmbclient.so
Compiling modules/vfs_recycle.c with -KPIC
Building plugin bin/recycle.so
Compiling modules/vfs_audit.c with -KPIC
Building plugin bin/audit.so
Compiling modules/vfs_extd_audit.c with -KPIC
Building plugin bin/extd_audit.so
Compiling modules/vfs_netatalk.c with -KPIC
"modules/vfs_netatalk.c", line 293: warning: end-of-loop code not reached
Building plugin bin/netatalk.so
Compiling modules/vfs_fake_perms.c with -KPIC
Building plugin bin/fake_perms.so
Compiling modules/vfs_default_quota.c with -KPIC
Building plugin bin/default_quota.so
Compiling modules/vfs_readonly.c with -KPIC
Compiling modules/getdate.c with -KPIC
"getdate.y", line 679: warning: implicit function declaration: strcmp
"getdate.y", line 736: warning: implicit function declaration: strlen
"getdate.y", line 740: warning: implicit function declaration: strncmp
Building plugin bin/readonly.so
Compiling modules/vfs_cap.c with -KPIC
Building plugin bin/cap.so
Compiling modules/CP850.c with -KPIC
Building plugin bin/CP850.so
Compiling modules/CP437.c with -KPIC
Building plugin bin/CP437.so
#
Comment 1 Tim Potter 2003-11-07 09:48:05 UTC
OK I've fixed a whole bunch of warnings, but a number of them remaining:

  - All the const char * ones (IMO const is a waste of time in C)
  - The initialiser out of range warnings (I can't understand why this warning
is being produced
Comment 2 Carl Erhorn 2003-11-18 18:02:26 UTC
Tim, 

I agree that const is fairly useless in C. It only forces the coder to play by
the rules, and some compilers even ignore that, allowing writes to the variable.
It wouldn't bother me at all if you pulled all the 'const' out of the code, but
that's only my opinion, and others would almost certainly object. 

I took a look at some of the 'initializer out of range', and found that it is
often due to initializing an unsigned variable with a signed value, such as -1.
While -1 is much more convenient than 0xffffffff, or some other semaphore-type
value, it's causing the compiler to complain in this way. I'd suggest that
either a cast is added to force the value to be unsigned (with some careful
testing to insure that it works the way you expect), or that a MACRO be used to
provide a convenient value without having to type in all the 'ffff's. 

For example, in lib/util_str.c, line 1910, we find:

SMB_BIG_UINT val = -1 ; 

This is one of the cases which does cause the initializer out of range errors.
It's caused by trying to shove a signed value into an unsigned variable. The
problem is that the types conflict, and actually should return a signed/unsigned
mismatch. But since it's immediate data being used, I guess the compiler uses
the out-of-range error instead. So I would either change this to:

SMB_BIG_UINT val = 0xffffffff ; 
or 
SMB_BIG_UINT val = (unsigned) -1 ;

I did not dig enough to see if a 'big_uint' is a long, or long long, but the hex
value would need to be adjusted to the right size to fill the variable, or
hopefully the use of the second approach would solve that problem, filling the
variable with ones, no matter how long it really is. Some quick testing would
show you the best approach. If it's not possible to force the cast to do what is
needed, then it might be useful to declare a MACRO like VAL_UNUSED, and set it
to whatever number of bits you need it to be. Once it's done, you can use it
anywhere, and not have to type all the junk in each time. 

That's all I can suggest for now - I hope it's a help. 
--Cerhorn
Comment 3 Gerald (Jerry) Carter 2004-03-22 08:08:27 UTC
closing this one since it is fairly old and 
we have a whole new set of output from SUn's compiler.
Marking as later.
Comment 4 Gerald (Jerry) Carter 2005-11-14 09:30:22 UTC
database cleanup