bug-gnulib
[Top][All Lists]
Advanced

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

Re: New clang-cl warnings


From: Bruno Haible
Subject: Re: New clang-cl warnings
Date: Fri, 12 May 2017 15:23:56 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-75-generic; KDE/5.18.0; x86_64; ; )

Gisle Vanem wrote:
> I'm not sure exactly when or how these new warnings from
> clang-cl happened (a lot of them):
> 
>    f:/ProgramFiler-x86/WindowsKits/Include/10.0.15063.0/ucrt/stdlib.h(78,5):
>      warning: macro expansion producing 'defined' has undefined behavior
>      [-Wexpansion-to-defined]
>    #if _CRT_INTERNAL_NONSTDC_NAMES
>        ^
>    
> f:\ProgramFiler-x86\WindowsKits\Include\10.0.15063.0\ucrt\corecrt.h(288,11):  
> note: expanded from macro
>          '_CRT_INTERNAL_NONSTDC_NAMES'
>            ( defined _CRT_DECLARE_NONSTDC_NAMES && 
> _CRT_DECLARE_NONSTDC_NAMES) || \
>              ^
> 
> Really, why?

Well, the compiler's "note" tells you: The system include files (corecrt.h in
your case) define _CRT_INTERNAL_NONSTDC_NAMES to some expression that includes
the 'defined' keyword.

You seem to be doing a native Windows compilation with the MSVC include files
and a non-Microsoft compiler [1]. This is not the among usual tested 
combinations;
good luck with this adventure :)

I just fixed a wrong #if in this area two days ago [2]; you can expect to find
more mistakes of this sort in gnulib and other GNU packages.

Bruno

[1] https://clang.llvm.org/docs/MSVCCompatibility.html
[2] 
https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=1888a27a1e48e4f8b9006c164ba1d1218a143c28




reply via email to

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