On 01/19/13 22:31, Paul Eggert wrote:

Could you please try this:

./configure
make clean
make V=1

I'm interested in the last (failing) command executed by the last 'make'.
Suppose it is like this:

gcc -std=gnu99  -I. -I./lib  -Ilib ... -o lib/stpncpy.o lib/stpncpy.c

Please send the relevant part of the preprocessed output for that command,
i.e., the output of

gcc -E -std=gnu99 -I. -I./lib  -Ilib ... lib/stpncpy.c


The failed command was:
===
depbase=`echo lib/stpncpy.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'` ; \
gcc -std=gnu99  -I. -I./lib  -Ilib -I./lib -Isrc -I./src    -g -O2 -MT 
lib/stpncpy.o -MD -MP -MF $depbase.Tpo -c -o lib/stpncpy.o lib/stpncpy.c
===

Attached is the output of:
===
gcc -E -std=gnu99  -I. -I./lib  -Ilib -I./lib -Isrc -I./src    -g -O2 -MT 
lib/stpncpy.o -MD -MP -MF lib/.deps/stpncpy.Tpo lib/stpncpy.c > stnpcpy.E.txt
===


I don't know exactly why, but it seems the definition of "stpncpy" is replaced

From:
===
char *
__stpncpy (char *dest, const char *src, size_t n)
{
  char c;
  char *s = dest;
===

To:
===
char *
((__builtin_object_size (char *dest, 0) != (size_t) -1) ? __builtin___stpncpy_chk 
(char *dest, const char *src, size_t n, __builtin_object_size (char *dest, 2 > 
1)) : __inline_stpncpy_chk (char *dest, const char *src, size_t n))
{
  char c;
  char *s = dest;
===

Which looks like some macro expansion, but I couldn't find the declaration of 
this macro.

-gordon
# 1 "lib/stpncpy.c"
# 1 "/Users/admin/Projects/coreutils-8.20.90-e27bfd//"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "lib/stpncpy.c"
# 22 "lib/stpncpy.c"
# 1 "./lib/config.h" 1
# 23 "lib/stpncpy.c" 2


# 1 "./lib/string.h" 1
# 22 "./lib/string.h"
       
# 23 "./lib/string.h" 3




# 1 "/usr/include/string.h" 1 3 4
# 61 "/usr/include/string.h" 3 4
# 1 "/usr/include/_types.h" 1 3 4
# 27 "/usr/include/_types.h" 3 4
# 1 "/usr/include/sys/_types.h" 1 3 4
# 32 "/usr/include/sys/_types.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
# 406 "/usr/include/sys/cdefs.h" 3 4
# 1 "/usr/include/sys/_symbol_aliasing.h" 1 3 4
# 407 "/usr/include/sys/cdefs.h" 2 3 4
# 472 "/usr/include/sys/cdefs.h" 3 4
# 1 "/usr/include/sys/_posix_availability.h" 1 3 4
# 473 "/usr/include/sys/cdefs.h" 2 3 4
# 33 "/usr/include/sys/_types.h" 2 3 4
# 1 "/usr/include/machine/_types.h" 1 3 4
# 32 "/usr/include/machine/_types.h" 3 4
# 1 "/usr/include/i386/_types.h" 1 3 4
# 37 "/usr/include/i386/_types.h" 3 4
typedef signed char __int8_t;



typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;

typedef long __darwin_intptr_t;
typedef unsigned int __darwin_natural_t;
# 70 "/usr/include/i386/_types.h" 3 4
typedef int __darwin_ct_rune_t;





typedef union {
 char __mbstate8[128];
 long long _mbstateL;
} __mbstate_t;

typedef __mbstate_t __darwin_mbstate_t;


typedef long int __darwin_ptrdiff_t;





typedef long unsigned int __darwin_size_t;





typedef __builtin_va_list __darwin_va_list;





typedef int __darwin_wchar_t;




typedef __darwin_wchar_t __darwin_rune_t;


typedef int __darwin_wint_t;




typedef unsigned long __darwin_clock_t;
typedef __uint32_t __darwin_socklen_t;
typedef long __darwin_ssize_t;
typedef long __darwin_time_t;
# 33 "/usr/include/machine/_types.h" 2 3 4
# 34 "/usr/include/sys/_types.h" 2 3 4
# 58 "/usr/include/sys/_types.h" 3 4
struct __darwin_pthread_handler_rec
{
 void (*__routine)(void *);
 void *__arg;
 struct __darwin_pthread_handler_rec *__next;
};
struct _opaque_pthread_attr_t { long __sig; char __opaque[56]; };
struct _opaque_pthread_cond_t { long __sig; char __opaque[40]; };
struct _opaque_pthread_condattr_t { long __sig; char __opaque[8]; };
struct _opaque_pthread_mutex_t { long __sig; char __opaque[56]; };
struct _opaque_pthread_mutexattr_t { long __sig; char __opaque[8]; };
struct _opaque_pthread_once_t { long __sig; char __opaque[8]; };
struct _opaque_pthread_rwlock_t { long __sig; char __opaque[192]; };
struct _opaque_pthread_rwlockattr_t { long __sig; char __opaque[16]; };
struct _opaque_pthread_t { long __sig; struct __darwin_pthread_handler_rec 
*__cleanup_stack; char __opaque[1168]; };
# 94 "/usr/include/sys/_types.h" 3 4
typedef __int64_t __darwin_blkcnt_t;
typedef __int32_t __darwin_blksize_t;
typedef __int32_t __darwin_dev_t;
typedef unsigned int __darwin_fsblkcnt_t;
typedef unsigned int __darwin_fsfilcnt_t;
typedef __uint32_t __darwin_gid_t;
typedef __uint32_t __darwin_id_t;
typedef __uint64_t __darwin_ino64_t;

typedef __darwin_ino64_t __darwin_ino_t;



typedef __darwin_natural_t __darwin_mach_port_name_t;
typedef __darwin_mach_port_name_t __darwin_mach_port_t;
typedef __uint16_t __darwin_mode_t;
typedef __int64_t __darwin_off_t;
typedef __int32_t __darwin_pid_t;
typedef struct _opaque_pthread_attr_t
   __darwin_pthread_attr_t;
typedef struct _opaque_pthread_cond_t
   __darwin_pthread_cond_t;
typedef struct _opaque_pthread_condattr_t
   __darwin_pthread_condattr_t;
typedef unsigned long __darwin_pthread_key_t;
typedef struct _opaque_pthread_mutex_t
   __darwin_pthread_mutex_t;
typedef struct _opaque_pthread_mutexattr_t
   __darwin_pthread_mutexattr_t;
typedef struct _opaque_pthread_once_t
   __darwin_pthread_once_t;
typedef struct _opaque_pthread_rwlock_t
   __darwin_pthread_rwlock_t;
typedef struct _opaque_pthread_rwlockattr_t
   __darwin_pthread_rwlockattr_t;
typedef struct _opaque_pthread_t
   *__darwin_pthread_t;
typedef __uint32_t __darwin_sigset_t;
typedef __int32_t __darwin_suseconds_t;
typedef __uint32_t __darwin_uid_t;
typedef __uint32_t __darwin_useconds_t;
typedef unsigned char __darwin_uuid_t[16];
typedef char __darwin_uuid_string_t[37];
# 28 "/usr/include/_types.h" 2 3 4
# 39 "/usr/include/_types.h" 3 4
typedef int __darwin_nl_item;
typedef int __darwin_wctrans_t;

typedef __uint32_t __darwin_wctype_t;
# 62 "/usr/include/string.h" 2 3 4


# 1 "/usr/include/Availability.h" 1 3 4
# 144 "/usr/include/Availability.h" 3 4
# 1 "/usr/include/AvailabilityInternal.h" 1 3 4
# 145 "/usr/include/Availability.h" 2 3 4
# 65 "/usr/include/string.h" 2 3 4



typedef __darwin_size_t size_t;
# 79 "/usr/include/string.h" 3 4

void *memchr(const void *, int, size_t);
int memcmp(const void *, const void *, size_t);
void *memcpy(void *, const void *, size_t);
void *memmove(void *, const void *, size_t);
void *memset(void *, int, size_t);
char *strcat(char *, const char *);
char *strchr(const char *, int);
int strcmp(const char *, const char *);
int strcoll(const char *, const char *);
char *strcpy(char *, const char *);
size_t strcspn(const char *, const char *);
char *strerror(int) __asm("_" "strerror" );
size_t strlen(const char *);
char *strncat(char *, const char *, size_t);
int strncmp(const char *, const char *, size_t);
char *strncpy(char *, const char *, size_t);
char *strpbrk(const char *, const char *);
char *strrchr(const char *, int);
size_t strspn(const char *, const char *);
char *strstr(const char *, const char *);
char *strtok(char *, const char *);
size_t strxfrm(char *, const char *, size_t);

# 113 "/usr/include/string.h" 3 4

char *strtok_r(char *, const char *, char **);

# 125 "/usr/include/string.h" 3 4

int strerror_r(int, char *, size_t);
char *strdup(const char *);
void *memccpy(void *, const void *, int, size_t);

# 139 "/usr/include/string.h" 3 4

char *stpcpy(char *, const char *);
char *stpncpy(char *, const char *, size_t) 
__attribute__((weak_import,visibility("default")));
char *strndup(const char *, size_t) 
__attribute__((weak_import,visibility("default")));
size_t strnlen(const char *, size_t) 
__attribute__((weak_import,visibility("default")));
char *strsignal(int sig);

# 155 "/usr/include/string.h" 3 4
typedef __darwin_ssize_t ssize_t;



void *memmem(const void *, size_t, const void *, size_t) 
__attribute__((weak_import,visibility("default")));
void memset_pattern4(void *, const void *, size_t) 
__attribute__((visibility("default")));
void memset_pattern8(void *, const void *, size_t) 
__attribute__((visibility("default")));
void memset_pattern16(void *, const void *, size_t) 
__attribute__((visibility("default")));

char *strcasestr(const char *, const char *);
char *strnstr(const char *, const char *, size_t);
size_t strlcat(char *, const char *, size_t);
size_t strlcpy(char *, const char *, size_t);
void strmode(int, char *);
char *strsep(char **, const char *);


void swab(const void * __restrict, void * __restrict, ssize_t);







# 1 "/usr/include/strings.h" 1 3 4
# 71 "/usr/include/strings.h" 3 4



int bcmp(const void *, const void *, size_t) ;
void bcopy(const void *, void *, size_t) ;
void bzero(void *, size_t) ;
char *index(const char *, int) ;
char *rindex(const char *, int) ;


int ffs(int);
int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);





int ffsl(long) __attribute__((visibility("default")));
int fls(int) __attribute__((visibility("default")));
int flsl(long) __attribute__((visibility("default")));


# 1 "./lib/string.h" 1 3 4
# 22 "./lib/string.h" 3 4
       
# 23 "./lib/string.h" 3




# 1 "/usr/include/string.h" 1 3 4
# 28 "./lib/string.h" 2 3





# 1 
"/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stddef.h" 1 
3 4
# 152 
"/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stddef.h" 3 
4
typedef long int ptrdiff_t;
# 326 
"/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/stddef.h" 3 
4
typedef int wchar_t;
# 34 "./lib/string.h" 2 3
# 422 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;
# 432 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;
# 481 "./lib/string.h" 3
extern void * mempcpy (void *restrict __dest, void const *restrict __src, 
size_t __n) __attribute__ ((__nonnull__ (1, 2)));




extern int _gl_cxxalias_dummy;


extern int _gl_cxxalias_dummy;
# 501 "./lib/string.h" 3
extern void * memrchr (void const *, int, size_t) __attribute__ ((__pure__)) 
__attribute__ ((__nonnull__ (1)));






extern int _gl_cxxalias_dummy;







extern int _gl_cxxalias_dummy;
# 531 "./lib/string.h" 3
extern void * rawmemchr (void const *__s, int __c_in) __attribute__ 
((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int _gl_cxxalias_dummy;







extern int _gl_cxxalias_dummy;
# 563 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
# 591 "./lib/string.h" 3
extern char * stpncpy (char *restrict __dst, char const *restrict __src, size_t 
__n) __attribute__ ((__nonnull__ (1, 2)));




extern int _gl_cxxalias_dummy;



extern int _gl_cxxalias_dummy;
# 632 "./lib/string.h" 3
extern char * strchrnul (char const *__s, int __c_in) __attribute__ 
((__pure__)) __attribute__ ((__nonnull__ (1)));






extern int _gl_cxxalias_dummy;
# 648 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;
# 675 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
# 697 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
# 723 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
# 743 "./lib/string.h" 3
extern size_t rpl_strnlen (char const *__string, size_t __maxlen) __attribute__ 
((__pure__)) __attribute__ ((__nonnull__ (1)));


extern int _gl_cxxalias_dummy;
# 755 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;
# 786 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;
# 795 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;
# 887 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;
# 897 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;
# 1044 "./lib/string.h" 3
extern size_t mbslen (const char *string) __attribute__ ((__pure__)) 
__attribute__ ((__nonnull__ (1)));


extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
# 1109 "./lib/string.h" 3
extern char * mbsstr (const char *haystack, const char *needle)
     __attribute__ ((__pure__))
     __attribute__ ((__nonnull__ (1, 2)));
# 1121 "./lib/string.h" 3
extern int mbscasecmp (const char *s1, const char *s2)
     __attribute__ ((__pure__))
     __attribute__ ((__nonnull__ (1, 2)));
# 1257 "./lib/string.h" 3
extern char * rpl_strerror (int);
extern int _gl_cxxalias_dummy;



extern int _gl_cxxalias_dummy;
# 1312 "./lib/string.h" 3
extern int _gl_cxxalias_dummy;

extern int _gl_cxxalias_dummy;
# 95 "/usr/include/strings.h" 2 3 4
# 181 "/usr/include/string.h" 2 3 4
# 190 "/usr/include/string.h" 3 4
# 1 "/usr/include/secure/_string.h" 1 3 4
# 32 "/usr/include/secure/_string.h" 3 4
# 1 "/usr/include/secure/_common.h" 1 3 4
# 33 "/usr/include/secure/_string.h" 2 3 4
# 58 "/usr/include/secure/_string.h" 3 4
static __inline void *
__inline_memcpy_chk (void *__dest, const void *__src, size_t __len)
{
  return __builtin___memcpy_chk (__dest, __src, __len, __builtin_object_size 
(__dest, 0));
}






static __inline void *
__inline_memmove_chk (void *__dest, const void *__src, size_t __len)
{
  return __builtin___memmove_chk (__dest, __src, __len, __builtin_object_size 
(__dest, 0));
}






static __inline void *
__inline_memset_chk (void *__dest, int __val, size_t __len)
{
  return __builtin___memset_chk (__dest, __val, __len, __builtin_object_size 
(__dest, 0));
}






static __inline char *
__inline_strcpy_chk (char *__restrict __dest, const char *__restrict __src)
{
  return __builtin___strcpy_chk (__dest, __src, __builtin_object_size (__dest, 
2 > 1));
}







static __inline char *
__inline_stpcpy_chk (char *__dest, const char *__src)
{
  return __builtin___stpcpy_chk (__dest, __src, __builtin_object_size (__dest, 
2 > 1));
}






static __inline char *
__inline_stpncpy_chk (char *__restrict __dest, const char *__restrict __src,
        size_t __len)
{
  return __builtin___stpncpy_chk (__dest, __src, __len, __builtin_object_size 
(__dest, 2 > 1));
}







static __inline char *
__inline_strncpy_chk (char *__restrict __dest, const char *__restrict __src,
        size_t __len)
{
  return __builtin___strncpy_chk (__dest, __src, __len, __builtin_object_size 
(__dest, 2 > 1));
}






static __inline char *
__inline_strcat_chk (char *__restrict __dest, const char *__restrict __src)
{
  return __builtin___strcat_chk (__dest, __src, __builtin_object_size (__dest, 
2 > 1));
}







static __inline char *
__inline_strncat_chk (char *__restrict __dest, const char *__restrict __src,
        size_t __len)
{
  return __builtin___strncat_chk (__dest, __src, __len, __builtin_object_size 
(__dest, 2 > 1));
}
# 191 "/usr/include/string.h" 2 3 4
# 28 "./lib/string.h" 2 3
# 26 "lib/stpncpy.c" 2







char *
((__builtin_object_size (char *dest, 0) != (size_t) -1) ? 
__builtin___stpncpy_chk (char *dest, const char *src, size_t n, 
__builtin_object_size (char *dest, 2 > 1)) : __inline_stpncpy_chk (char *dest, 
const char *src, size_t n))
{
  char c;
  char *s = dest;

  if (n >= 4)
    {
      size_t n4 = n >> 2;

      for (;;)
        {
          c = *src++;
          *dest++ = c;
          if (c == '\0')
            break;
          c = *src++;
          *dest++ = c;
          if (c == '\0')
            break;
          c = *src++;
          *dest++ = c;
          if (c == '\0')
            break;
          c = *src++;
          *dest++ = c;
          if (c == '\0')
            break;
          if (--n4 == 0)
            goto last_chars;
        }
      n -= dest - s;
      goto zero_fill;
    }

 last_chars:
  n &= 3;
  if (n == 0)
    return dest;

  for (;;)
    {
      c = *src++;
      --n;
      *dest++ = c;
      if (c == '\0')
        break;
      if (n == 0)
        return dest;
    }

 zero_fill:
  while (n-- > 0)
    dest[n] = '\0';

  return dest - 1;
}

Reply via email to