Some Solaris 8/Sun CC warnings with 2.0.7 pre 2

David Collier-Brown davecb at canada.sun.com
Tue Mar 21 19:40:29 GMT 2000


These are also from a configuration including --with-smbwrapper, but 
nothing else, on SunOS 5.8 Generic,  sun4u sparc Ultra-60 using cc
5.x.

---------
Compiling param/loadparm.c with -Kpic
"param/loadparm.c", line 2025: warning: argument #2 is incompatible 
	with prototype:
        prototype: pointer to struct stat {ulong st_dev, array[3] of 
		long st_pad1, ulong st_ino, ulong st_mode, ulong st_nlink, 			long
st_uid, lo... : "/usr/include/sys/stat_impl.h", line 26
        argument : pointer to struct stat64 {ulong st_dev, array[3] of 
		long  st_pad1, ullong st_ino, ulong st_mode, ulong st_nlink,
		 long st_uid,...

I suspect we should have just stat, not stat64...
Looking at config.cache, we see:
$ grep stat64 config.cache
ac_cv_func___fstat64=${ac_cv_func___fstat64='no'}
ac_cv_func___lstat64=${ac_cv_func___lstat64='no'}
ac_cv_func___stat64=${ac_cv_func___stat64='no'}
ac_cv_func__fstat64=${ac_cv_func__fstat64='yes'}
ac_cv_func__lstat64=${ac_cv_func__lstat64='yes'}
ac_cv_func__stat64=${ac_cv_func__stat64='yes'}
ac_cv_func_fstat64=${ac_cv_func_fstat64='yes'}
ac_cv_func_lstat64=${ac_cv_func_lstat64='yes'}
ac_cv_func_stat64=${ac_cv_func_stat64='yes'}

It's a warning for an identical struct with a "64" in its name.  

I wonder if I need a 5.8 case in configure... I'll try that as we
speak.
Nope!  Same effect.  The options selected by configure
(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64) are valid for Slolaris
8.  
Must be something else.

Hmmn: in a 64-bit, large-files-ok OS like Solaris 8, there should be
no "64" interfaces at all.  I'll try editing config.cache to make
them disappear and see what I get.

[Well, for one thing, I get overridden!  
ac_cv_func_fstat64=${ac_cv_func_fstat64='yes'}
ac_cv_func_lstat64=${ac_cv_func_lstat64='yes'}
ac_cv_func_stat64=${ac_cv_func_stat64='yes'}
Ok, I'll hand-edit them back out (;-)]

Yes, it compiles happily and finds the non-64 interfaces
if config.cache is changed.

Reccomendations:
	1) don't do anyhing for 2.0.7, it's just a warning
	2) for 2.0.8ff, amend the configure script to
	   use xxx() not xxx(64) in OSs supporting 64-bit
	   files by default.  This probably means a flag
	   native_largefiles, which is set for SunOS >= 5.8
	   and any other native 64bit OS (eg, Irix)

	The xxx64() interfaces are really only for 32-bit
	OSs which support 64-bit filesizes via structs and
	functions using "long long" parameters and members.
	Sun calls them "transitional", in the sense of "doomed".



------
Compiling lib/util_unistr.c with -Kpic
"lib/util_unistr.c", line 786: warning: statement not reached
---
/*******************************************************************
 Compare the two strings s1 and s2. len is in ucs2 units.
********************************************************************/

int wstrcmp(const smb_ucs2_t *s1, const smb_ucs2_t *s2)
{
        smb_ucs2_t c1, c2;

        for (;;) {
                c1 = *s1++;
                c2 = *s2++;

                if (c1 != c2)
                        return c1 - c2;

                if (c1 == 0)
            return 0;
    }
        return 0;   <-- line 786
}

The second return 0 is bogoid... I reccomend it disappear.
----------


--dave
--
David Collier-Brown in Boston
Phone: (781) 442-0734, Room BUR03-3632


More information about the samba-technical mailing list