I'm tracking a compiling issue with 2.2.8a on AIX 5.2-ML01 with IBM C for AIX 6.0 and i'm having an issue with lib/snprintf.c The first thing i noticed is that "includes.h" is not included which is in many other places, but I'm sure there are reaasons. The other thing is there is a check at the beginning for HAVE_SNPRINTF, HAVE_VSNPRINTF and HAVE_C99_VSNPRINTF to include stdio.h - that one i get. the one i don't get is at line 790: #if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_SNPRINTF) i can't find a HAVE_C99_SNPRINTF anywhere in configure unless it's under another name, but it seems to me based on the description given by "mbp" in the code that it may need to look like this: #if !defined(HAVE_SNPRINTF) || !defined(HAVE_SNPRINTF_DECL) anyway the bug i'm tracking is a failure to expand the macros SAFE_FREE and VA_COPY. is compiles fine in AIX 5.1. as soon as i figure that one out, i'll forward it. Bill
On Wed, Jun 25, 2003 at 06:53:45PM -0400, William Jojo wrote:> I'm tracking a compiling issue with 2.2.8a on AIX 5.2-ML01 with IBM C for > AIX 6.0 and i'm having an issue with lib/snprintf.c > > The first thing i noticed is that "includes.h" is not included which is > in many other places, but I'm sure there are reaasons.I'm not sure why either but there probably is a good reason. (-:> The other thing is there is a check at the beginning for HAVE_SNPRINTF, > HAVE_VSNPRINTF and HAVE_C99_VSNPRINTF to include stdio.h - that one i > get. the one i don't get is at line 790: > > #if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_SNPRINTF) > > i can't find a HAVE_C99_SNPRINTF anywhere in configure unless it's under > another name, but it seems to me based on the description given by > "mbp" in the code that it may need to look like this:This should be HAVE_C99_VSNPRINTF (it's fixed in Samba 3.0). You might get a different error though. Give it a go and let me know what happens. Tim.
On Wed, 25 Jun 2003, William Jojo wrote:> > anyway the bug i'm tracking is a failure to expand the macros SAFE_FREE > and VA_COPY. is compiles fine in AIX 5.1. as soon as i figure that one > out, i'll forward it. >found it. you are penalized in snprintf.c if you have all three of HAVE_SNPRINTF, HAVE_VSNPRINTF and HAVE_C99_VSNPRINTF by what i believe is an unnecessary else clause. It will include stdio.h, but will not define SAFE_FREE and VA_COPY. AIX 5.1 does not have vsnprintf so it compiles there. I think this is what the change should be - pardon my misuse if diff, i would like to know the correct format for submitting patches, but could not find it during my short search of the site. *** snprintf.orig Wed Jun 25 19:20:54 2003 --- snprintf.c Wed Jun 25 19:23:31 2003 *************** *** 87,89 **** ! /* make the compiler happy with an empty file */ ! void dummy_snprintf(void) {} ! #else --- 87 ---- ! #endif *************** *** 114 **** - #endif --- 111 ---- *************** *** 790 **** ! #if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_SNPRINTF) --- 787 ---- ! #if !defined(HAVE_SNPRINTF) || !defined(HAVE_SNPRINTF_DECL) Bill