Compiling samba 2.2.8 on HP-UX 11.00 - conflicting

Ladner, Eric (Eric.Ladner) Eric.Ladner at chevrontexaco.com
Thu Mar 20 13:56:06 GMT 2003


Comment the definition of vsnprintf out altogether.  If there is a
header for it in stdio.h, then it's a libc function (or something) and
shouldn't be redefinied in the source.  Wrap the whole function top to
bottom in a comment or find the HAS_VSNPRINTF definition in the main
definition header file and set it to 0 (I can't remember if that
funciton is wrapped in a define, but it should be).  I'm curious why if
some combination of HP-UX/gcc has the funciton, it's not beinig
identified at ./configure time and not compiled.

Eric

-----Original Message-----
From: Adam Fox [mailto:adam.fox at gribbles.com.au] 
Sent: Wednesday, March 19, 2003 18:42
To: samba-technical at lists.samba.org
Cc: Ladner, Eric (Eric.Ladner)
Subject: RE: Compiling samba 2.2.8 on HP-UX 11.00 - conflicting


Thanks Eric, that fixed one of the functions. The functions are declared
as:

in stdio.h:
     extern int snprintf(char *, __size_t, char *,...);
     extern int vsnprintf(char *, __size_t, const char *, __va__list);

in snprintf.c:
 int vsnprintf (char *str, size_t count, const char *fmt, va_list args)
{  int snprintf(char *str,size_t count,const char *fmt,...)

I removed the const from the snprintf function in snprintf.c and that
fixed that conflict, but I'm not sure what to do about the vsnprintf
function. I can't see any differences! Then again, I'm not the worlds
greatest C programmer, so I'm probably missing something blindingly
obvious. Does anyone know what I can change in the vsnprintf function to
make the compiler happy?

Thanks

Adam Fox.


Eric Ladner wrote:

I believe the only difference is a 'const' modifier on one of the
arguments in the declaration of the function.  I can't remember if I had
to comment out the implementation part of the fucntions or not.

I edited the source and added the const to the file that didn't have it
and all was right with the world.

E

-----Original Message-----
From: Adam Fox [mailto:adam.fox at gribbles.com.au]=20
Sent: Tuesday, March 18, 2003 23:39
To: samba-technical at lists.samba.org
Subject: Compiling samba 2.2.8 on HP-UX 11.00 - conflicting definition
of snprintf


Hi all,

I'm trying to compile samba 2.2.8 on a HP-UX 11.00 system. I've run the
configure script without any arguments, but when I run 'make' I get the
following error:

Compiling lib/snprintf.c
lib/snprintf.c:777: conflicting types for `vsnprintf'
/var/bin/../lib/gcc-lib/hppa2.0w-hp-hpux11.00/3.0/include/stdio.h:494:
previous
declaration of `vsnprintf'
lib/snprintf.c:792: conflicting types for `snprintf'
/var/bin/../lib/gcc-lib/hppa2.0w-hp-hpux11.00/3.0/include/stdio.h:493:
previous
declaration of `snprintf'
*** Error exit code 1

I did some searching on the mailing list and found other people having
the same problem with other versions of samba, but I didn't find any
solutions. When I ran configure the following was reported about the
printf functions:

checking for asprintf declaration... no
checking for vasprintf declaration... no
checking for vsnprintf declaration... yes
checking for snprintf declaration... yes
[...]
checking for vsnprintf... yes
checking for snprintf... yes
checking for asprintf... no
checking for vasprintf... no

One suggestion I saw was to comment out line 492 and 493 of the stdio.h
from the HP-UX include directory, but I'm not too keen on mucking around
with the HP files. Is it possible to not redefine the snprintf functions
and just use the one that comes with HP-UX?

Any help is appreciated.


Adam Fox


Attention:
The information contained in this message and or attachments is intended
only for the person or entity to which it is addressed and may contain
confidential and/or privileged material.  Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please contact
the sender and delete the material from any system and destroy any
copies.

Any views expressed in this message are those of the individual sender
and may not necessarily reflect the views of The Gribbles Group.

Thank You.

Whilst every effort has been made to ensure that this e-mail message and
any attachments are free from viruses, you should scan this message and
any attachments. Under no circumstances do we accept liability for any
loss or damage which may result from your receipt of this message or any
attachment.




More information about the samba-technical mailing list