Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   C11 Compiler Test Suite (http://www.velocityreviews.com/forums/t952242-c11-compiler-test-suite.html)

Chicken McNuggets 09-14-2012 09:20 PM

C11 Compiler Test Suite
 
Does anyone know if a C11 compiler test suite is available?

If not might I suggest that one be written? It would certainly be
something that I would be interested in helping with and I think it
might well have the advantage of pushing open source (and possibly
closed source) compilers to support the full standard quicker than if
there was no test suite to call them out on their support.

It could be a project that might be quite easy to coordinate on
something like Github.

For instance I know that Clang supports some of the features of C11
already but having inquired on the LLVM IRC channel there is no public
documentation stating what is available. Nor can I find any specific
information on the state of GCC's C11 support.

It is essential that the C community makes some noise about C11 support
as most compiler vendors seem to be concentrating on C++11.

steve.b.hafner@gmail.com 09-22-2012 03:03 PM

Re: C11 Compiler Test Suite
 
On Friday, September 14, 2012 3:20:30 PM UTC-6, Chicken McNuggets wrote:
> Does anyone know if a C11 compiler test suite is available?
>
>
>
> If not might I suggest that one be written? It would certainly be
>
> something that I would be interested in helping with and I think it
>
> might well have the advantage of pushing open source (and possibly
>
> closed source) compilers to support the full standard quicker than if
>
> there was no test suite to call them out on their support.
>


Don't know, but efforts could be combined easily if you start and you find similar projects along the way.

Anyway, grab the C11 standard:

http://www.open-std.org/jtc1/sc22/wg...docs/n1570.pdf

and C99 standard:

http://www.open-std.org/jtc1/sc22/wg...docs/n1256.pdf

and have at it, if you like.

>
>
> For instance I know that Clang supports some of the features of C11
>
> already but having inquired on the LLVM IRC channel there is no public
>
> documentation stating what is available. Nor can I find any specific
>
> information on the state of GCC's C11 support.
>


See

http://clang.llvm.org/docs/LanguageExtensions.html#c11

and the release notes for GCC 4.7 series:

http://gcc.gnu.org/gcc-4.7/changes.html

where it states:

"There is support for some more features from the C11 revision of the ISO C standard. GCC now accepts the options -std=c11 and -std=gnu11, in addition to the previous -std=c1x and -std=gnu1x.

"Unicode strings (previously supported only with options such as -std=gnu11, now supported with -std=c11), and the predefined macros __STDC_UTF_16__ and __STDC_UTF_32__.

-- Nonreturning functions (_Noreturn and <stdnoreturn.h>).
-- Alignment support (_Alignas, _Alignof, max_align_t, <stdalign.h>).
-- A built-in function __builtin_complex is provided to support C library implementation of the CMPLX family of macros."


>
>
> It is essential that the C community makes some noise about C11 support


The most effective noise is someone working at solving the problems. You're a person just like any other.


Chicken McNuggets 09-26-2012 11:54 AM

Re: C11 Compiler Test Suite
 
On 22/09/2012 16:03, steve.b.hafner@gmail.com wrote:
> On Friday, September 14, 2012 3:20:30 PM UTC-6, Chicken McNuggets wrote:


>> It is essential that the C community makes some noise about C11 support

>
> The most effective noise is someone working at solving the problems. You're a person just like any other.
>


True. I'll certainly have a look into it once I have some free time in
the coming weeks.

I was really just interested in seeing if there was much interest from
people in the project.

Kaz Kylheku 09-26-2012 06:11 PM

Re: C11 Compiler Test Suite
 
On 2012-09-14, Chicken McNuggets <chicken@mcnuggets.com> wrote:
> It is essential that the C community makes some noise about C11 support


No, it isn't. Not only is is not essential, it is counterproductive.
The "C community" should just go about its business and not mess with its
compilers or libraries, except in those areas where they are foudn to be
broken.

Chicken McNuggets 09-29-2012 11:22 PM

Re: C11 Compiler Test Suite
 
On 26/09/2012 19:11, Kaz Kylheku wrote:
> On 2012-09-14, Chicken McNuggets <chicken@mcnuggets.com> wrote:
>> It is essential that the C community makes some noise about C11 support

>
> No, it isn't. Not only is is not essential, it is counterproductive.
> The "C community" should just go about its business and not mess with its
> compilers or libraries, except in those areas where they are foudn to be
> broken.
>


If a compiler does not follow the standard (and that includes the latest
standard) then I would argue that the compiler is broken. Full standards
support is not optional. It should be demanded.

Kaz Kylheku 09-30-2012 04:14 AM

Re: C11 Compiler Test Suite
 
On 2012-09-29, Chicken McNuggets <chicken@mcnuggets.com> wrote:
> On 26/09/2012 19:11, Kaz Kylheku wrote:
>> On 2012-09-14, Chicken McNuggets <chicken@mcnuggets.com> wrote:
>>> It is essential that the C community makes some noise about C11 support

>>
>> No, it isn't. Not only is is not essential, it is counterproductive.
>> The "C community" should just go about its business and not mess with its
>> compilers or libraries, except in those areas where they are foudn to be
>> broken.
>>

>
> If a compiler does not follow the standard (and that includes the latest
> standard) then I would argue that the compiler is broken.


You would argue, but you'd be wrong. Something is broken if it doesn't
implement its specification. The choice of specification is the implementor's
privilege. If someone writes a compiler that is documented as conforming to
ISO 9899:1990, and it does exactly that, then it's not broken in any way.

> Full standards support is not optional. It should be demanded.


Such a thing can be demanded by making a monetary bid. Offer someone
money to make or patch you a C11 compiler.

Chicken McNuggets 09-30-2012 01:49 PM

Re: C11 Compiler Test Suite
 
On 30/09/2012 05:14, Kaz Kylheku wrote:
> On 2012-09-29, Chicken McNuggets <chicken@mcnuggets.com> wrote:
>> On 26/09/2012 19:11, Kaz Kylheku wrote:
>>> On 2012-09-14, Chicken McNuggets <chicken@mcnuggets.com> wrote:
>>>> It is essential that the C community makes some noise about C11 support
>>>
>>> No, it isn't. Not only is is not essential, it is counterproductive.
>>> The "C community" should just go about its business and not mess with its
>>> compilers or libraries, except in those areas where they are foudn to be
>>> broken.
>>>

>>
>> If a compiler does not follow the standard (and that includes the latest
>> standard) then I would argue that the compiler is broken.

>
> You would argue, but you'd be wrong. Something is broken if it doesn't
> implement its specification. The choice of specification is the implementor's
> privilege. If someone writes a compiler that is documented as conforming to
> ISO 9899:1990, and it does exactly that, then it's not broken in any way.


This is incorrect the C11 standard states explicitly:

"This third edition cancels and replaces the second edition, ISO/IEC
9899:1999, as
corrected by ISO/IEC 9899:1999/Cor 1:2001, ISO/IEC 9899:1999/Cor 2:2004, and
ISO/IEC 9899:1999/Cor 3:2007."

thus the only way to be standards compliant is by supporting the latest
standard. If you only support C90 or C99 then you are not standards
compliant as the C11 standard explicitly states it cancels and replaces
all previous standards. Likewise C99 stated that it canceled and
replaced C90.


Rui Maciel 09-30-2012 02:16 PM

Re: C11 Compiler Test Suite
 
Chicken McNuggets wrote:

> This is incorrect the C11 standard states explicitly:
>
> "This third edition cancels and replaces the second edition, ISO/IEC
> 9899:1999, as
> corrected by ISO/IEC 9899:1999/Cor 1:2001, ISO/IEC 9899:1999/Cor 2:2004,
> and ISO/IEC 9899:1999/Cor 3:2007."
>
> thus the only way to be standards compliant is by supporting the latest
> standard. If you only support C90 or C99 then you are not standards
> compliant as the C11 standard explicitly states it cancels and replaces
> all previous standards. Likewise C99 stated that it canceled and
> replaced C90.


Your comment is detached from reality. No matter what is stated in that
paragraph, which should be noted that it isn't enforced by anyone or
anything, people still write code and develop compilers which target and
support specific versions of the C standard which precede ISO/IEC 9899:2011,
and neither of those ceasses to be C if a new revision is published.

In addition, if your comment made any sense then it would mean that once a
new revision of the C standard was released, suddenly no software in the
world would have been developed in C.

There is a reason why standards are referred not only by their name but also
by their revision number/publication date.


Rui Maciel

Keith Thompson 09-30-2012 09:22 PM

Re: C11 Compiler Test Suite
 
Chicken McNuggets <chicken@mcnuggets.com> writes:
> On 30/09/2012 05:14, Kaz Kylheku wrote:
>> On 2012-09-29, Chicken McNuggets <chicken@mcnuggets.com> wrote:
>>> On 26/09/2012 19:11, Kaz Kylheku wrote:
>>>> On 2012-09-14, Chicken McNuggets <chicken@mcnuggets.com> wrote:
>>>>> It is essential that the C community makes some noise about C11 support
>>>>
>>>> No, it isn't. Not only is is not essential, it is
>>>> counterproductive. The "C community" should just go about its
>>>> business and not mess with its compilers or libraries, except in
>>>> those areas where they are foudn to be broken.
>>>
>>> If a compiler does not follow the standard (and that includes the
>>> latest standard) then I would argue that the compiler is broken.

>>
>> You would argue, but you'd be wrong. Something is broken if it
>> doesn't implement its specification. The choice of specification is
>> the implementor's privilege. If someone writes a compiler that is
>> documented as conforming to ISO 9899:1990, and it does exactly that,
>> then it's not broken in any way.

>
> This is incorrect the C11 standard states explicitly:
>
> "This third edition cancels and replaces the second edition, ISO/IEC
> 9899:1999, as corrected by ISO/IEC 9899:1999/Cor 1:2001, ISO/IEC
> 9899:1999/Cor 2:2004, and ISO/IEC 9899:1999/Cor 3:2007."
>
> thus the only way to be standards compliant is by supporting the
> latest standard. If you only support C90 or C99 then you are not
> standards compliant as the C11 standard explicitly states it cancels
> and replaces all previous standards. Likewise C99 stated that it
> canceled and replaced C90.


That's true in a sense, but practically speaking it's not.

The ISO C standard (any version of it) does not have the force
of law. Some jurisdiction could pass a law requiring conformance
to it; I know of none that have done so. And a contract requiring
conformance could be enforced by law. But there's no fundamental
reason why such a contract, or even such a law, couldn't specify
a standard other than the current one.

If a vendor states that an implementation conforms to the C90 or C99
standard, we all know what that means, and it's a very useful piece
of information. The *only* thing missing in that situation is that
ISO doesn't recognize it as a conforming implementation. Anyone not
speaking officially on behalf of ISO is free to accept or reject
that implementation, on that or any other basis. And if a compiler
that's claimed to conform to C90 doesn't let me use "restrict" as an
identifier, or fails to diagnose mixed declarations and statements
within a block, then I have a legitimate basis for a bug report.

And even within the context of ISO, the current C++ standard is
ISO/IEC 14882:2011 (C++11). It includes ISO/IEC 9899:1999 (C99)
as a normative reference.

Old versions of standard do not cease to exist when ISO declares
them obsolete.

Having said all that, I personally would like to see much better
support for the current C standard, and I find, for example,
Microsoft's decision not to support either C99 or C11 annoying.
But Microsoft doesn't get enough money from me for my opinion to
be very relevant to them.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"

Kaz Kylheku 10-01-2012 09:56 PM

Re: C11 Compiler Test Suite
 
On 2012-09-30, Chicken McNuggets <chicken@mcnuggets.com> wrote:
> On 30/09/2012 05:14, Kaz Kylheku wrote:
>> On 2012-09-29, Chicken McNuggets <chicken@mcnuggets.com> wrote:
>>> On 26/09/2012 19:11, Kaz Kylheku wrote:
>>>> On 2012-09-14, Chicken McNuggets <chicken@mcnuggets.com> wrote:
>>>>> It is essential that the C community makes some noise about C11 support
>>>>
>>>> No, it isn't. Not only is is not essential, it is counterproductive.
>>>> The "C community" should just go about its business and not mess with its
>>>> compilers or libraries, except in those areas where they are foudn to be
>>>> broken.
>>>>
>>>
>>> If a compiler does not follow the standard (and that includes the latest
>>> standard) then I would argue that the compiler is broken.

>>
>> You would argue, but you'd be wrong. Something is broken if it doesn't
>> implement its specification. The choice of specification is the implementor's
>> privilege. If someone writes a compiler that is documented as conforming to
>> ISO 9899:1990, and it does exactly that, then it's not broken in any way.

>
> This is incorrect the C11 standard states explicitly:


I did not write anything incorrect ...

> "This third edition cancels and replaces the second edition, ISO/IEC
> 9899:1999, as
> corrected by ISO/IEC 9899:1999/Cor 1:2001, ISO/IEC 9899:1999/Cor 2:2004, and
> ISO/IEC 9899:1999/Cor 3:2007."
>
> thus the only way to be standards compliant is by supporting the latest
> standard.


... because I was addressing myself to the term "broken", and did not
write a single word about the term "standards compliant".

> If you only support C90 or C99 then you are not standards
> compliant as the C11 standard explicitly states it cancels and replaces
> all previous standards. Likewise C99 stated that it canceled and
> replaced C90.


That does not make existing copies of C90 spontaneously combust.
People continue to have old documents in their libraries.

So there continues to be a C90 language, with a defining document. We can write
something which conforms to that document.

Whether the result is called "standard conforming" is about as important as
debating how many angels you can fit on on top of the head of a modern day
comp.lang.c regular.


All times are GMT. The time now is 05:16 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.