[vlc-devel] [PATCH 2/2] thread: fix compilation with clang 7 or older

Hugo Beauzée-Luyssen hugo at beauzee.fr
Thu Feb 27 16:02:24 CET 2020


On Thu, Feb 27, 2020, at 3:50 PM, Rémi Denis-Courmont wrote:
> Point being, it's a compiler bug, which is already fixed. Don't use old 
> buggy EOL compilers. This patch is wrong.
> 
> Le 27 février 2020 16:36:19 GMT+02:00, Alexandre Janniaux 
> <ajanni at videolabs.io> a écrit : Hi,
> > 
> > Yes, but according to the page ePirat linked, the DR 459 is
> > fixed in C17 which is ISO/IEC 9899:2018, and previous
> > revision was 9899:2012 if I'm not wrong.
> > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2244.htm
> > https://www.iso.org/standard/61717.html
> > 
> > About Clang 6 or 7 failing with std=c17, I don't know and
> > might be the bug you mention (as it is fixed right after)
> > but it doesn't impact us as we're not using C17/18 afaik.
> > 
> > Regards,
> > --
> > Alexandre Janniaux
> > Videolabs
> > 
> > On Thu, Feb 27, 2020 at 03:59:41PM +0200, Rémi Denis-Courmont wrote:
> >>  Hi,
> >> 
> >>  C99 had 4 editions, the last one in 2007. C11 had at least 2 editions before 2017.
> >> 
> >>  But even if you consider the 2017 edition a different version altogether, how do you explain that clang 6 and 7 fail to build with -std=c17 ?
> >> 
> >>  Le 27 février 2020 14:50:49 GMT+02:00, Alexandre Janniaux <ajanni at videolabs.io> a écrit :
> >>> Hi,
> >>> 
> >>> On Thu, Feb 27, 2020 at 01:14:52PM +0200, Rémi Denis-Courmont wrote:
> >>>> If you think we should go back to pre-2011, you need to make a patch
> >>> to fiw the C code and configure script accordingly. And this (C/C++11)
> >>> *was* discussed and agreed upon here, by the way.
> >>> 
> >>> This «mistake» is part of the last draft on C11 and, like
> >>> ePirat mentionned it, the issue was raised on March 22 2014
> >>> so it seems to be part of C11 standard afaik.
> >>> 
> >>> Did something changed in the final private C11 norm with
> >>> regards to this prototype? It would seem weird that the
> >>> issue was raised three years later if it was already fixed.
> >>> 
> >>> Regards,
> >>> --
> >>> Alexandre Janniaux
> >>> Videolabsvlc-devel mailing list
> >>> To unsubscribe or modify your subscription options:
> >>> https://mailman.videolan.org/listinfo/vlc-devel
> >> --

I don't understand how this is a compiler issue. The C11 standard (at least the draft I have, which is N1570) states that the 1st parameter to atomic_load must be pointer to non constant, and the code passes a pointer to constant.
AFAICS, the current code isn't valid C11.
If anything, the current code builds because of a liberal implementation of atomic_load that tolerates pointers to const values.

Regards,

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list