This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Solaris 10 fixincludes tweak


Bruce Korb wrote:

> Maybe the real best fix is to send a patch to *Sun* suggesting that
> they fix their initializer code so that there is a #define initializer for
> upad64_t that varies by whether it is a fundamental type or a union.
> Until that is done, there will always be some sort of grief.  So for now,
> we have to kludge our way along.

Even if they do, we still have to live with Solaris 10 and older for
years to come...

>> The more proximate cuase is that the condition for whether or not
>> upad64_t is a union or an integer type is:
>>
>>   #if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
>>
>> on older Solaris, and:
>>
>>   #if (_HAVE_LONGLONG)
>>
>> on newer Solaris.  The Solaris headers arrange that the latter is
>> always true for GCC, but the former, with -ansi, is false.  So, I
>> changed the fix to check to see that the __STDC__ formulation appears
>> in sys/types.h.
>>
>> Is this patch OK?  Any better ideas?
> 
> The perfect solution would be to write a C-code fix that parsed the sys/types.h
> header to emit a pthread.h wrapper to #undef the broken defines and emitted
> alternate text initializers using the same #if conditions found in sys/types.h
> for the upad64_t thingey. a la:

Yes, that would probably be somewhat better.  Is it worth it, though?
Seriously, I'm not aware of a situation in which my changes can do the
wrong thing.  (On Solaris 10, the condition in sys/types.h will never be
true for GCC, no matter what command-line options you pass, so upad64t
will always be an int.)

If you're not sanguine about my patch, though, and you're willing to do
the infrastructure work, I'll try to fill it in as you suggest.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]