latest 2.2 CVS does not compile

Alexander Bokovoy a.bokovoy at sam-solutions.net
Tue Jan 15 11:57:04 GMT 2002


Seems I've found source of problem:

In glibc 2.2.4 (and before, of course) there are lot of optimisations in
<bits/string.h> including optimizations for strncat:


/* Append no more than N characters from SRC onto DEST.  */
#define _HAVE_STRING_ARCH_strncat 1
#define strncat(dest, src, n) \
  (__extension__ ({ char *__dest = (dest);				      \
		    __builtin_constant_p (src) && __builtin_constant_p (n)    \
		    ? (strlen (src) < ((size_t) (n))			      \
>		       ? strcat (__dest, src)				      \
		       : (*((char *)__mempcpy (strchr (__dest, '\0'),	      \
					       (__const char *) src, n)) = 0, \
			   __dest))					      \
		    : __strncat_g (__dest, src, n); }))

__STRING_INLINE char *__strncat_g (char *__dest, __const char __src[],
				   size_t __n);

and more.

This quoted strcat() call causes the problem. The <bits/string.h> is
included under following conditions:

#if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \
    && defined __GNUC__ && __GNUC__ >= 2 && !__BOUNDED_POINTERS__ 

<code>

#endif

It appears that __USE_STRING_INLINES is defined somewhere else in included
headers which causes this bug.
-- 
/ Alexander Bokovoy
$ cat /proc/identity >~/.signature
  `Senior software developer and analyst for SaM-Solutions Ltd.`
---
Nov 21 20:58:58 alconost kernel: VFS: Busy inodes after unmount. 
		    Self-destruct in 5 seconds.  Have a nice day...




More information about the samba-technical mailing list