[Bug middle-end/36282] Spurious warning "asm declaration ignored due to conflict with previous rename"

aldot at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 22 12:59:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36282

Bernhard Reutner-Fischer <aldot at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at ucw dot cz

--- Comment #4 from Bernhard Reutner-Fischer <aldot at gcc dot gnu.org> 2013-03-22 12:59:10 UTC ---
(In reply to comment #3)
> Confirmed.
> 
> Still the same with gcc version 4.7.2 (Debian 4.7.2-5):
> $ cat <<EOF | gcc -x c -c - -o /dev/null
> #pragma weak __pthread_initialize
> extern void *memcpy(void *dest, const void *src, int n);
> extern typeof(memcpy) memcpy asm("__GI_memcpy");
> EOF
> <stdin>:2:14: warning: conflicting types for built-in function ‘memcpy’
> [enabled by default]
> <stdin>:3:1: warning: asm declaration ignored due to conflict with previous
> rename [-Wpragmas]

Works as expected if one provides a decl before the #pragma:

$ cat <<EOF | gcc -fno-builtin -x c -c - -o /dev/null
extern void __pthread_initialize (void);
#pragma weak __pthread_initialize
extern void *memcpy(void *dest, const void *src, int n);
extern typeof(memcpy) memcpy asm("__GI_memcpy");
EOF
$ cat <<EOF | gcc -fno-builtin -x c -c - -o /dev/null
#pragma weak __pthread_initialize
extern void __pthread_initialize (void);
extern void *memcpy(void *dest, const void *src, int n);
extern typeof(memcpy) memcpy asm("__GI_memcpy");
EOF
<stdin>:4:1: warning: asm declaration ignored due to conflict with previous
rename [-Wpragmas]

Honza, does that ring a bell, by chance?


More information about the Gcc-bugs mailing list