Csound Csound-dev Csound-tekno Search About

[Csnd-dev] Which language version?

Date2017-11-15 21:16
Fromrasmus ekman
Subject[Csnd-dev] Which language version?
I thought Csound is written in C99 (several mentions of C99 in code, and I thought I read it on this list sometime).

But Travis fails my code for a variable declaration in for statement:
for (int x = 0; ...

What language and version can I use?

Thanks,
    /re

Date2017-11-15 21:36
FromSteven Yi
SubjectRe: [Csnd-dev] Which language version?
Good question; I thought were at some point got to an agreement to use
C99. (Visual Studio does not itself support all of C99 or C11, but
does support most anything we'd probably use.)  I think from looking
at the build failure on travis:

https://travis-ci.org/csound/csound/builds/302470027#L1377

Looking at Travis, the build is done using Trusty (Ubuntu 14.04), and
it is using GCC 4.8.  The manual for 4.8 says that the default C
standard being used is gnu90 (equivalent to C90 with some extensions I
believe).

https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Standards.html#Standards

Since the build is passing for AppVeyor, I think we could do:

1. Merge in the PR.  This will fail the develop build.
2. Immediately modify the CMake to explicitly set the C standard to
C99 (-std=c99 ) when compiling with gcc.  This should work on gcc 4.8
and later versions, should fix the build for Travis, and continue to
work for non-gcc builds.

John, Victor: Any objections to this?



On Wed, Nov 15, 2017 at 4:16 PM, rasmus ekman  wrote:
> I thought Csound is written in C99 (several mentions of C99 in code, and I
> thought I read it on this list sometime).
>
> But Travis fails my code for a variable declaration in for statement:
> for (int x = 0; ...
>
> What language and version can I use?
>
> Thanks,

Date2017-11-15 22:11
FromVictor Lazzarini
SubjectRe: [Csnd-dev] Which language version?
I am happy with C99, would be happier with C11, but see the difficulties.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 15 Nov 2017, at 21:37, Steven Yi <stevenyi@GMAIL.COM> wrote:

Good question; I thought were at some point got to an agreement to use
C99. (Visual Studio does not itself support all of C99 or C11, but
does support most anything we'd probably use.)  I think from looking
at the build failure on travis:

https://travis-ci.org/csound/csound/builds/302470027#L1377

Looking at Travis, the build is done using Trusty (Ubuntu 14.04), and
it is using GCC 4.8.  The manual for 4.8 says that the default C
standard being used is gnu90 (equivalent to C90 with some extensions I
believe).

https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Standards.html#Standards

Since the build is passing for AppVeyor, I think we could do:

1. Merge in the PR.  This will fail the develop build.
2. Immediately modify the CMake to explicitly set the C standard to
C99 (-std=c99 ) when compiling with gcc.  This should work on gcc 4.8
and later versions, should fix the build for Travis, and continue to
work for non-gcc builds.

John, Victor: Any objections to this?



On Wed, Nov 15, 2017 at 4:16 PM, rasmus ekman <re@abc.se> wrote:
I thought Csound is written in C99 (several mentions of C99 in code, and I
thought I read it on this list sometime).

But Travis fails my code for a variable declaration in for statement:
for (int x = 0; ...

What language and version can I use?

Thanks,
   /re

Date2017-11-16 15:57
Fromjpff
SubjectRe: [Csnd-dev] Which language version?
I much prefer c89, but can live with the nasties of c99 as long as the 
compilers can deal with it.  My experience of the form "for (int i=0; 
i<10; i++)" is that not all compilers I used accepted it.


On Wed, 15 Nov 2017, Victor Lazzarini wrote:

> I am happy with C99, would be happier with C11, but see the difficulties.
> 
> Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
> 
> On 15 Nov 2017, at 21:37, Steven Yi  wrote:
>
>       Good question; I thought were at some point got to an agreement to
>       use
>       C99. (Visual Studio does not itself support all of C99 or C11, but
>       does support most anything we'd probably use.)  I think from
>       looking
>       at the build failure on travis:
>
>       https://travis-ci.org/csound/csound/builds/302470027#L1377
>
>       Looking at Travis, the build is done using Trusty (Ubuntu 14.04),
>       and
>       it is using GCC 4.8.  The manual for 4.8 says that the default C
>       standard being used is gnu90 (equivalent to C90 with some
>       extensions I
>       believe).
>
>       https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Standards.html#Standards
>
>       Since the build is passing for AppVeyor, I think we could do:
>
>       1. Merge in the PR.  This will fail the develop build.
>       2. Immediately modify the CMake to explicitly set the C standard
>       to
>       C99 (-std=c99 ) when compiling with gcc.  This should work on gcc
>       4.8
>       and later versions, should fix the build for Travis, and continue
>       to
>       work for non-gcc builds.
>
>       John, Victor: Any objections to this?
> 
> 
>
>       On Wed, Nov 15, 2017 at 4:16 PM, rasmus ekman  wrote:
>             I thought Csound is written in C99 (several mentions
>             of C99 in code, and I
>
>             thought I read it on this list sometime).
> 
>
>             But Travis fails my code for a variable declaration in
>             for statement:
>
>             for (int x = 0; ...
> 
>
>             What language and version can I use?
> 
>
>             Thanks,
>
>                /re
> 
> 
>