[PATCH] libcpp: Use [[likely]] conditionally

Jeff Law jeffreyalaw@gmail.com
Tue Nov 23 15:38:46 GMT 2021



On 11/23/2021 8:26 AM, Christophe LYON via Gcc-patches wrote:
> Hi!
>
> On 23/11/2021 01:26, Jeff Law via Gcc-patches wrote:
>>
>>
>> On 11/22/2021 10:22 AM, Marek Polacek via Gcc-patches wrote:
>>> Let's hide [[likely]] behind a macro, to suppress warnings if the
>>> compiler doesn't support it.
>>>
>>> Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
>>>
>>> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?
>>>
>>>     PR preprocessor/103355
>>>
>>> libcpp/ChangeLog:
>>>
>>>     * lex.c: Use ATTR_LIKELY instead of [[likely]].
>>>     * system.h (ATTR_LIKELY): Define.
>> OK
>> jeff
>
>
> This patch breaks the build when the host compiler is gcc-4.8.5, 
> because __has_cpp_attribute is not defined.
Sigh.  I'd like to move to a more recent prereq if we could.


>
> Is this small patch OK with a proper ChangeLog?
Yes.  Sorry about the breakage.
jeff




More information about the Gcc-patches mailing list