bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] gdb: Fix build error on macOS


From: Enze Li
Subject: Re: [PATCH] gdb: Fix build error on macOS
Date: Tue, 5 Oct 2021 12:51:29 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

[ add bug-gnulib@gnu.org ]

On 10/4/21 6:03 PM, Enze Li via Gdb-patches wrote:
> PR build/28413 notes that the gdb master fails to build on macOS.
> 
> Based on De Morgan's law, the expression
> !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
> is equal to (!defined __GNUC__ || defined __clang__ || !__OPTIMIZE).
> The expression above looks weird, maybe there are some problems with
> this way of judging. When any one of the conditions is established, the
> subsequent judgment will be ignored.
> 
> This patch works around the issue by rewriting the expression of
> judgment after referring to the nearby notes.
> 
> Tested by building on x86_64-Linux and macOS(Mojave & Catalina).
> 
> Bug: https://sourceware.org/PR28413
> ---
>  gnulib/import/c++defs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gnulib/import/c++defs.h b/gnulib/import/c++defs.h
> index 39df1bc76bc..dbbae2f1fa2 100644
> --- a/gnulib/import/c++defs.h
> +++ b/gnulib/import/c++defs.h
> @@ -286,7 +286,7 @@
>     _GL_CXXALIASWARN_2 (func, namespace)
>  /* To work around GCC bug 
> <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
>     we enable the warning only when not optimizing.  */
> -# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
> +# if defined __GNUC__ && !defined __clang__ && !__OPTIMIZE__
>  #  define _GL_CXXALIASWARN_2(func,namespace) \
>      _GL_WARN_ON_USE (func, \
>                       "The symbol ::" #func " refers to the system function. 
> " \
> @@ -314,7 +314,7 @@
>     _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
>  /* To work around GCC bug 
> <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
>     we enable the warning only when not optimizing.  */
> -# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
> +# if defined __GNUC__ && !defined __clang__ && !__OPTIMIZE__
>  #  define 
> _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
>      _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
>                           "The symbol ::" #func " refers to the system 
> function. " \
> 



reply via email to

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