RFC: architecture define probably masks variable names in header files
Martin.Buchholz at Sun.COM
Wed Jan 23 09:49:59 PST 2008
I care, and agree with you.
I recall many years ago, debugging a mysterious failure building Emacs.
Building on Solaris-Sparc defined the symbol "sparc",
and this caused the build to fail, only if a component of the
current working directory was "sparc".
Christian Thalinger wrote:
> On Wed, 2008-01-16 at 23:04 +0100, Christian Thalinger wrote:
>>Today I noticed that it's not a good idea to use an architecture define
>>as done in OpenJDK:
>>CPPFLAGS_COMMON = -D$(ARCH) -DARCH='"$(ARCH)"' -DLINUX $(VERSION_DEFINES) \
>> -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
>>The -D$(ARCH) e.g. on an Alpha system makes big problems because a lot
>>of variables are called "alpha" in GUI code.
>>I tried to patch the OpenJDK code in IcedTea but then I reached a point
>>where it's not possible to fix the issue:
>>typedef struct png_color_8_struct
>> png_byte red; /* for use in red green blue files */
>> png_byte green;
>> png_byte blue;
>> png_byte gray; /* for use in grayscale files */
>> png_byte alpha; /* for alpha channel files */
>>This won't work.
>>Normally build systems use architecture defines as __ALPHA__ or
>>__alpha__ (these are also defined by the C compiler).
>>Any chance to get this thing changed/fixed upstream in the OpenJDK code?
>>As I can't think of another solution of that problem...
>>Probably someone decides to name a function argument "sparc"
> So... noone cares?
> - twisti
More information about the build-dev