compiler standards (and/or min gcc version) supported with installed headers ?

Andreas Jaeger aj@suse.com
Thu Jan 3 17:30:00 GMT 2013


On 01/03/2013 05:33 PM, Carlos O'Donell wrote:
> On 01/03/2013 11:29 AM, Andreas Jaeger wrote:
>> On 01/03/2013 05:25 PM, Carlos O'Donell wrote:
>>> On 01/03/2013 10:58 AM, Joseph S. Myers wrote:
>>>> On Thu, 3 Jan 2013, Andreas Jaeger wrote:
>>>>
>>>>>> Thus for example we could get rid of the GCC 2.91 check for __builtin_memset
>>>>>> in sysdeps/unix/sysv/linux/bits/sched.h and clean that up.
>>>>>
>>>>> That raises a separate question - shall we assume that non-GCC compilers have
>>>>> __builtin_memset as well?
>>>>>
>>>>> Otherwise the cleanup would be to change the got to use
>>>>> GLIBC_HAVE_BUILTIN_MEMSET - and define that for GCC.
>>>>
>>>> Defining __GLIBC_HAVE_BUILTIN_MEMSET seems logically right.  (You can't
>>>> just define __builtin_memset to memset because string.h may not be
>>>> included.  So you don't really clean much up in this case because you
>>>> still have both cases in the code - and given that there's still a GCC
>>>> conditional somewhere, there doesn't really seem to be much advantage in
>>>> the test being __GNUC__ instead of __GNUC_PREREQ (2, 91).)
>>>
>>> Good question about alternative compilers.
>>>
>>> I have no objection to the cleanup that makes this a feature.
>>>
>>> I guess the next step then is to enumerate supported compilers
>>> and then decide if the feature is to be assumed or not, and then
>>> follow that up with further cleanup.
>>
>> right now, I would only mention GCC as supported compiler - and add
>> others only if somebody steps up that is using that compiler and will
>> take care of the support on glibc. nevertheless, I would be
>> conservate and handle GCC extensions as extensions - something we
>> need to test for before using it.
>
> Well in that case then the GLIBC_HAVE_BUILTIN_MEMSET is *assumed*
> since we support only GCC, and versions 2.91 or newer always
> have that builtin, so the code can be cleaned up?
>
> Did I understand that correctly?

What about clang, icc etc? We do want to have the framework to support 
it. So, since builtin_memset is a GCC extension, I would add a feature 
macro around it. If then e.g. clang understands it as well, we can 
define GLIBC_HAVE_BUILTIN_MEMSET for clang,

Andreas
-- 
  Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
   SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
    GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
     GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126



More information about the Libc-alpha mailing list