On Wed, Mar 13, 2019 at 8:04 AM Jim Jagielski <j...@jagunet.com> wrote:

>
> Yeah, I also think it depends on the version of clang... previous versions
> did not flag
>
>     /usr/local/include/unicode/uenum.h:1:1: error: // comments are not
> allowed in this language [-Werror,-Wcomment]
>
> as fatal errors.


Just looking on Fedora 29, their distribution and truly the vanilla libxml2
source package 2.9.9...

In include/libxml2 tree (dropping all the dups);
grep -r "#include" . | grep -v "<libxml/"
./SAX.h:#include <stdio.h>
./SAX.h:#include <stdlib.h>
./xmlwriter.h:#include <stdarg.h>
./tree.h:#include <limits.h>
./nanoftp.h:#include <winsock2.h>
./encoding.h:#include <iconv.h>
./encoding.h:#include <unicode/ucnv.h>

That's about as vanilla as things get for a C project; no '//' comments.
the problem is in the last item, as you observe above;
 /usr/local/include/unicode/uenum.h:1:1: error: // comments are not allowed
in this language [-Werror,-Wcomment]

Confirmed `grep -r "^[\t ]*//" .` on FC29 that modern /usr/include/unicode/
is full of '//' comments, entirely because...
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
*   Copyright (C) 2002-2013, International Business Machines
...

unicode maintainers did a simple mass-license-update pass in 2016 through
these files using C99/C++ conventions without thinking much about it. The
relevant package on FC29 is libicu-devel-62.1-3.fc29.x86_64 : ("Development
files for International Components for Unicode").

gcc (GCC) 8.3.1 as shipping on FC29 does not flag these comments. Seems
like clang might have become too enthusiastic about enforcing only K&R
comments, lending the question of whether this is quirk falls entirely on
Apple.

Reply via email to