bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

__builtin_expect used in regex


From: arnold
Subject: __builtin_expect used in regex
Date: Sun, 30 Sep 2018 05:25:58 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Hello GNULIB guys.

Pleae see the patch below which Nelson needs in order to compile
gawk on several of his systems.  This comes from the use of the BE
macro in regex.

Nelson, please chime in with a list of the system + compiler combinations
where gawk needs this patch.  As I mentioned, this is really a gnulib
issue and thus I'm reporting it there.

I will apply this patch, probably later this week, unless the GNULIB
guys, with your help, can patch regex directly.

Thanks,

Arnold

> Date: Sat, 29 Sep 2018 16:05:35 -0600
> From: "Nelson H. F. Beebe" <address@hidden>
> To: "Arnold Robbins" <address@hidden>
> Cc: address@hidden
>
> I propose the following patch to fix the __builtin_expect() problem:
>
> % cat /home/gnu/src/gawk/gawk-2018-09-29.patch.p1
> *** custom.h.org        Sat Sep 29 14:22:37 2018
> --- custom.h    Sat Sep 29 14:56:04 2018
> ***************
> *** 53,58 ****
> --- 53,64 ----
>   #endif
>   #endif
>   
> + #ifndef __GNUC__
> + #ifndef __builtin_expect
> + #define __builtin_expect(expr, val) (expr)
> + #endif
> + #endif
> + 
>   /* For QNX, based on submission from Michael Hunter, address@hidden */
>   #ifdef __QNX__
>   #define GETPGRP_VOID  1
>
>
> I have applied it on a half-dozen systems that failed to build today
> from the gawk-2018-09-29 snapshot that I pulled earlier this afternoon;
> all of those systems then had successful builds.
>
> I'm still uncomfortable with the fact that a compiler-specific
> feature, __builtin_expect, was used without adequate fallback
> for non-gcc compiler builds.  My patch remedies that problem.
>
> -------------------------------------------------------------------------------
> - Nelson H. F. Beebe                    Tel: +1 801 581 5254                  
> -
> - University of Utah                    FAX: +1 801 581 4148                  
> -
> - Department of Mathematics, 110 LCB    Internet e-mail: address@hidden  -
> - 155 S 1400 E RM 233                       address@hidden  address@hidden -
> - Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ 
> -
> -------------------------------------------------------------------------------
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]