[Samba] conflict in lib/snprintf using gcc-2.95.3 on HPUX 11. 00

MCCALL,DON (HP-USA,ex1) don_mccall at hp.com
Thu Feb 7 13:31:47 GMT 2002


Hi Renee,
Well, I have been pulling 2.2.3, 2.2.3a for the past several weeks, and
building it on HP-UX 11.0 and 11.i consistently without this issue.  I'm not
using gcc, but the HP-UX Ansi CC, and I am not able to reproduce this issue.


Look at the following line from your errors:

/usr/local/gcc-2.95.3/lib/gcc-lib/hppa2.0w-hp-hpux11.00/2.95.3/include/stdio
.h:447: previous declaration of `snprintf'

Looking at lib/snprintf.c I see the following:

#if defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF) &&
defined(HAVE_C99_VSNPRI
NTF)
/* only include stdio.h if we are not re-defining snprintf or vsnprintf */
#include <stdio.h>
 /* make the compiler happy with an empty file */
 void dummy_snprintf(void) {}
#else

Which tells me that for some reason on YOUR system, configure is deciding
that vsnprintf IS C99 compliant... or it wouldn't be including stdio.h;
Take a look at your include/config.h and grep for C99, tell me what you see.

Thanks,
Don


-----Original Message-----
From: René Nieuwenhuizen [mailto:R.Nieuwenhuizen at cpb.nl]
Sent: Thursday, February 07, 2002 3:15 PM
To: MCCALL,DON (HP-USA,ex1); Samba Technical
Subject: Re: [Samba] conflict in lib/snprintf using gcc-2.95.3 on HPUX
11.00


Well I'm sure it's not fixed since I just downloaded 2.2.3a, ran configure
and tried to compile it... But can you tell me what the fix should be?

Thanks,

René Nieuwenhuizen

----- Original Message -----
From: "MCCALL,DON (HP-USA,ex1)" <don_mccall at hp.com>
To: "'René Nieuwenhuizen'" <R.Nieuwenhuizen at cpb.nl>; "Samba Technical"
<samba-technical at lists.samba.org>
Sent: Thursday, February 07, 2002 9:02 PM
Subject: RE: [Samba] conflict in lib/snprintf using gcc-2.95.3 on HPUX 11.00



Hello Rene,
This should be fixed at 2.2.3a - try doing a make clean, and make sure you
remove your
config.cache, and then run configure and make again.
Don
-----Original Message-----
From: René Nieuwenhuizen [mailto:R.Nieuwenhuizen at cpb.nl]
Sent: Thursday, February 07, 2002 2:49 PM
To: Samba Technical
Subject: [Samba] conflict in lib/snprintf using gcc-2.95.3 on HPUX 11.00


Hi,

Compiling samba-2.2.2/2.2.3(a) using CC or gcc-2.95.3 on HP/UX 11.00 fails
with the following message:

============================================================================
=
Compiling lib/snprintf.c
In file included from lib/snprintf.c:63:
/usr/local/gcc-2.95.3/lib/gcc-lib/hppa2.0w-hp-hpux11.00/2.95.3/include/strin
g.h:29: warning: conflicting types for built-in function `memcmp'
/usr/local/gcc-2.95.3/lib/gcc-lib/hppa2.0w-hp-hpux11.00/2.95.3/include/strin
g.h:85: warning: conflicting types for built-in function `memcpy'
/usr/local/gcc-2.95.3/lib/gcc-lib/hppa2.0w-hp-hpux11.00/2.95.3/include/strin
g.h:87: warning: conflicting types for built-in function `memset'
lib/snprintf.c:775: conflicting types for `snprintf'
/usr/local/gcc-2.95.3/lib/gcc-lib/hppa2.0w-hp-hpux11.00/2.95.3/include/stdio
.h:447: previous declaration of `snprintf'
*** Error exit code 1
============================================================================
=

I looked at the code which states:

============================================================================
=
/* yes this really must be a ||. Don't muck wiith this (tridge)
 *
 * The logic for these two is that we need our own definition if the
 * OS *either* has no definition of *sprintf, or if it does have one
 * that doesn't work properly according to the autoconf test.  Perhaps
 * these should really be smb_snprintf to avoid conflicts with buggy
 * linkers? -- mbp
 */
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_SNPRINTF)
============================================================================
=

So I have SNPRINTF but it seems not to be C99_SNPRINTF???

What should I do? And is this code right?

René Nieuwenhuizen
Sysadmin
CPB Netherlands Bureau for Economic Policy Analysis







More information about the samba-technical mailing list