On Thu, Sep 21, 2017 at 07:09:04PM +0200, Vittorio Giovara wrote:
> On Thu, Sep 21, 2017 at 6:35 PM, Diego Biurrun <[email protected]> wrote:
> > On Thu, Sep 21, 2017 at 01:44:44PM +0200, Vittorio Giovara wrote:
> > > Silence warnings such as:
> > >
> > >  libavformat/udp.c:27:9: warning: '_DEFAULT_SOURCE'
> > >        macro redefined [-Wmacro-redefined]
> > >  #define _DEFAULT_SOURCE
> > >          ^
> > >  <command line>:4:9: note: previous definition is here
> > >  #define _DEFAULT_SOURCE 1
> > >          ^
> > > ---
> > > I'm not sure this is the right approach, since configure explicitly adds
> > >         add_${pfx}cppflags -D_DEFAULT_SOURCE
> > > in my compiler flag...
> > > Any better ideas?
> >
> > And why would it do that? What is your libc?
> 
> It's the latest clang toolchain available on macOS
> 
> Apple LLVM version 9.0.0 (clang-900.0.37)
> Target: x86_64-apple-darwin16.7.0

The issue is that there is no special support for the MacOS libc and the
detection falls through to the default entry at the bottom. That entry
was made to add -D_DEFAULT_SOURCE in 551746680462538bb5ad7adf55fb1248190428ec
by Luca some years ago. In the previous commit the fallback was
"-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600", before that nothing.

I'm not entirely confident that this is the right fallback. Maybe Luca can
enlighten us as to why (musl?) he made that change in the first place. If
we want to keep it, then Vittorio should add detection for MacOS libc and
add no preprocessor flags in that case.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to