This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Another GLIBC build error with GCC6
- From: Steve Ellcey <sellcey at imgtec dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 21 Jul 2015 13:52:00 -0700
- Subject: Re: Another GLIBC build error with GCC6
- Authentication-results: sourceware.org; auth=none
- References: <1437496279 dot 19674 dot 126 dot camel at ubuntu-sellcey> <1437507995 dot 19674 dot 136 dot camel at ubuntu-sellcey> <55AEA71B dot 2020405 at redhat dot com>
- Reply-to: <sellcey at imgtec dot com>
> Any chance I could get you to file a GCC bug for this bogus warning?
>
> Jeff
Here is a cutdown test case, but I am not sure exactly what
DT_EXTRATAGIDX is trying to accomplish so I can't explain why GCC should
(or should not) give a warning here. If you define MODIFIED you get
the code with my new definition of DT_EXTRATAGIDX and fewer warnings
but the if statement still gives a warning in either case.
Steve Ellcey
#include <stdint.h>
typedef uint32_t Elf32_Word;
typedef int32_t Elf32_Sword;
typedef struct
{
int x;
} Elf32_Dyn;
#define DT_NUM 34
#define DT_MIPS_NUM 0x36
#define DT_THISPROCNUM DT_MIPS_NUM
#define DT_VERSIONTAGNUM 16
#define DT_EXTRANUM 3
#define DT_VALNUM 12
#define DT_ADDRNUM 11
#define DT_AUXILIARY 0x7ffffffd
#define DT_FILTER 0x7fffffff
#ifndef MODIFIED
#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1) /* original version */
#else
#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) & 0x7fffffff)-1) /* my new version */
#endif
#define DT_NEEDED 1
#define AUXTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \
+ DT_EXTRATAGIDX (DT_AUXILIARY))
#define FILTERTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM \
+ DT_EXTRATAGIDX (DT_FILTER))
/* include/elf.h */
Elf32_Dyn *l_info[DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGNUM
+ DT_EXTRANUM + DT_VALNUM + DT_ADDRNUM];
int foo()
{
if (l_info[DT_NEEDED] || l_info[AUXTAG] || l_info[FILTERTAG])
return 1;
else
return 0;
}