Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

<Stealth> How do I bind a computer to an NIS server? <Joey> Use a rope? -- Seen on #Debian


devel / comp.std.c / Re: Migration from C89/C99 to C11/C17

SubjectAuthor
* Migration from C89/C99 to C11/C17Сергей Басыров
`* Re: Migration from C89/C99 to C11/C17David Brown
 `* Re: Migration from C89/C99 to C11/C17Sergey Basyrov
  `* Re: Migration from C89/C99 to C11/C17David Brown
   `- Re: Migration from C89/C99 to C11/C17Sergey Basyrov

1
Migration from C89/C99 to C11/C17

<02151a8c-4491-4367-9ea1-86fdfdda42fen@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=314&group=comp.std.c#314

  copy link   Newsgroups: comp.std.c
X-Received: by 2002:ac8:7315:: with SMTP id x21mr1451052qto.392.1629949938214;
Wed, 25 Aug 2021 20:52:18 -0700 (PDT)
X-Received: by 2002:aca:d06:: with SMTP id 6mr974498oin.105.1629949937958;
Wed, 25 Aug 2021 20:52:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.std.c
Date: Wed, 25 Aug 2021 20:52:17 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=37.204.160.208; posting-account=rm_mLQoAAACgVBGStkMgeODKfvMKHQDU
NNTP-Posting-Host: 37.204.160.208
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <02151a8c-4491-4367-9ea1-86fdfdda42fen@googlegroups.com>
Subject: Migration from C89/C99 to C11/C17
From: pms...@gmail.com (Сергей Басыров)
Injection-Date: Thu, 26 Aug 2021 03:52:18 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1129
 by: Сергей Бас - Thu, 26 Aug 2021 03:52 UTC

Hello everyone!

What do you think about code migration of legacy C code to new C standarts?

And what tools can help to do that?

Re: Migration from C89/C99 to C11/C17

<sg7i0t$93i$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=315&group=comp.std.c#315

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.std.c
Subject: Re: Migration from C89/C99 to C11/C17
Date: Thu, 26 Aug 2021 10:05:48 +0200
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <sg7i0t$93i$1@dont-email.me>
References: <02151a8c-4491-4367-9ea1-86fdfdda42fen@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 26 Aug 2021 08:05:49 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="88c9bacb65ea2036705abae614c98530";
logging-data="9330"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wGWSdWWWOkciqC16XaDL+2dLuh565/r0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:ROj/dtUiwyoYbPiFypN4ywpUjIs=
In-Reply-To: <02151a8c-4491-4367-9ea1-86fdfdda42fen@googlegroups.com>
Content-Language: en-GB
 by: David Brown - Thu, 26 Aug 2021 08:05 UTC

On 26/08/2021 05:52, Сергей Басыров wrote:
> Hello everyone!
>
> What do you think about code migration of legacy C code to new C standarts?
>
> And what tools can help to do that?
>

You usually don't need to do anything.

Code that is good C99 is almost certainly equally good as C11, as the
changes between C99 and C11 are primarily the addition of features such
as atomics and threading, generics, and standardisation of some common
compiler extensions. C17 is just a bug-fix of C11, and the changes only
affect quite obscure corner cases (AFAIUI).

The big difference was C89/C90 to C99. Again, most of it was new
features that are not going to affect existing code unless you happen to
use some of the new keywords as identifiers. But there are occasional
differences, such as the types of some integer constants and possible
differences in rounding for division with negative integers.

If you have specific questions or code that you'd like help with,
comp.lang.c is probably a better newsgroup.

Re: Migration from C89/C99 to C11/C17

<88e4d8d0-1dcd-485b-91da-7c7233f70f8cn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=316&group=comp.std.c#316

  copy link   Newsgroups: comp.std.c
X-Received: by 2002:ac8:6b8b:: with SMTP id z11mr2547181qts.153.1629975109841;
Thu, 26 Aug 2021 03:51:49 -0700 (PDT)
X-Received: by 2002:a9d:798f:: with SMTP id h15mr2557789otm.227.1629975109045;
Thu, 26 Aug 2021 03:51:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.std.c
Date: Thu, 26 Aug 2021 03:51:48 -0700 (PDT)
In-Reply-To: <sg7i0t$93i$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=37.204.160.208; posting-account=rm_mLQoAAACgVBGStkMgeODKfvMKHQDU
NNTP-Posting-Host: 37.204.160.208
References: <02151a8c-4491-4367-9ea1-86fdfdda42fen@googlegroups.com> <sg7i0t$93i$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <88e4d8d0-1dcd-485b-91da-7c7233f70f8cn@googlegroups.com>
Subject: Re: Migration from C89/C99 to C11/C17
From: pms...@gmail.com (Sergey Basyrov)
Injection-Date: Thu, 26 Aug 2021 10:51:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Sergey Basyrov - Thu, 26 Aug 2021 10:51 UTC

четверг, 26 августа 2021 г. в 11:05:52 UTC+3, David Brown:
> On 26/08/2021 05:52, Сергей Басыров wrote:
> > Hello everyone!
> >
> > What do you think about code migration of legacy C code to new C standarts?
> >
> > And what tools can help to do that?
> >
> You usually don't need to do anything.
>
> Code that is good C99 is almost certainly equally good as C11, as the
> changes between C99 and C11 are primarily the addition of features such
> as atomics and threading, generics, and standardisation of some common
> compiler extensions. C17 is just a bug-fix of C11, and the changes only
> affect quite obscure corner cases (AFAIUI).
>
>
> The big difference was C89/C90 to C99. Again, most of it was new
> features that are not going to affect existing code unless you happen to
> use some of the new keywords as identifiers. But there are occasional
> differences, such as the types of some integer constants and possible
> differences in rounding for division with negative integers.
>
>
> If you have specific questions or code that you'd like help with,
> comp.lang.c is probably a better newsgroup.

Thank you David!

So, I can just change "-std" option of gcc and C program will work better?

Re: Migration from C89/C99 to C11/C17

<sg82lo$vcj$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=317&group=comp.std.c#317

  copy link   Newsgroups: comp.std.c
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: david.br...@hesbynett.no (David Brown)
Newsgroups: comp.std.c
Subject: Re: Migration from C89/C99 to C11/C17
Date: Thu, 26 Aug 2021 14:49:59 +0200
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <sg82lo$vcj$1@dont-email.me>
References: <02151a8c-4491-4367-9ea1-86fdfdda42fen@googlegroups.com>
<sg7i0t$93i$1@dont-email.me>
<88e4d8d0-1dcd-485b-91da-7c7233f70f8cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 26 Aug 2021 12:50:00 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="88c9bacb65ea2036705abae614c98530";
logging-data="32147"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19AsY4unK+LCjn8VEieaizGuvuiWDQgYAs="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:MNSeIXtwuy5isdVupoa4iUkq2t8=
In-Reply-To: <88e4d8d0-1dcd-485b-91da-7c7233f70f8cn@googlegroups.com>
Content-Language: en-GB
 by: David Brown - Thu, 26 Aug 2021 12:49 UTC

On 26/08/2021 12:51, Sergey Basyrov wrote:
> четверг, 26 августа 2021 г. в 11:05:52 UTC+3, David Brown:
>> On 26/08/2021 05:52, Сергей Басыров wrote:
>>> Hello everyone!
>>>
>>> What do you think about code migration of legacy C code to new C standarts?
>>>
>>> And what tools can help to do that?
>>>
>> You usually don't need to do anything.
>>
>> Code that is good C99 is almost certainly equally good as C11, as the
>> changes between C99 and C11 are primarily the addition of features such
>> as atomics and threading, generics, and standardisation of some common
>> compiler extensions. C17 is just a bug-fix of C11, and the changes only
>> affect quite obscure corner cases (AFAIUI).
>>
>>
>> The big difference was C89/C90 to C99. Again, most of it was new
>> features that are not going to affect existing code unless you happen to
>> use some of the new keywords as identifiers. But there are occasional
>> differences, such as the types of some integer constants and possible
>> differences in rounding for division with negative integers.
>>
>>
>> If you have specific questions or code that you'd like help with,
>> comp.lang.c is probably a better newsgroup.
>
> Thank you David!
>
> So, I can just change "-std" option of gcc and C program will work better?
>

No, it will work exactly alike (baring these very few corner cases).
You don't get the advantage of newer C standards unless you write code
that uses them. And most of the benefits are about making it easier to
write clearer and safer C code, there will normally be no effect on the
speed, size or correctness of the resulting compiled code. C99 lets you
write better source code than C90, it does not let you get better
results from old code.

Re: Migration from C89/C99 to C11/C17

<9a2cb310-f8fd-4be2-9181-db05344253d1n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=318&group=comp.std.c#318

  copy link   Newsgroups: comp.std.c
X-Received: by 2002:ac8:108a:: with SMTP id a10mr3759792qtj.14.1629990625830;
Thu, 26 Aug 2021 08:10:25 -0700 (PDT)
X-Received: by 2002:a9d:798c:: with SMTP id h12mr3494682otm.215.1629990622120;
Thu, 26 Aug 2021 08:10:22 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.std.c
Date: Thu, 26 Aug 2021 08:10:21 -0700 (PDT)
In-Reply-To: <sg82lo$vcj$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=37.204.160.208; posting-account=rm_mLQoAAACgVBGStkMgeODKfvMKHQDU
NNTP-Posting-Host: 37.204.160.208
References: <02151a8c-4491-4367-9ea1-86fdfdda42fen@googlegroups.com>
<sg7i0t$93i$1@dont-email.me> <88e4d8d0-1dcd-485b-91da-7c7233f70f8cn@googlegroups.com>
<sg82lo$vcj$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9a2cb310-f8fd-4be2-9181-db05344253d1n@googlegroups.com>
Subject: Re: Migration from C89/C99 to C11/C17
From: pms...@gmail.com (Sergey Basyrov)
Injection-Date: Thu, 26 Aug 2021 15:10:25 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 59
 by: Sergey Basyrov - Thu, 26 Aug 2021 15:10 UTC

четверг, 26 августа 2021 г. в 15:50:03 UTC+3, David Brown:
> On 26/08/2021 12:51, Sergey Basyrov wrote:
> > четверг, 26 августа 2021 г. в 11:05:52 UTC+3, David Brown:
> >> On 26/08/2021 05:52, Сергей Басыров wrote:
> >>> Hello everyone!
> >>>
> >>> What do you think about code migration of legacy C code to new C standarts?
> >>>
> >>> And what tools can help to do that?
> >>>
> >> You usually don't need to do anything.
> >>
> >> Code that is good C99 is almost certainly equally good as C11, as the
> >> changes between C99 and C11 are primarily the addition of features such
> >> as atomics and threading, generics, and standardisation of some common
> >> compiler extensions. C17 is just a bug-fix of C11, and the changes only
> >> affect quite obscure corner cases (AFAIUI).
> >>
> >>
> >> The big difference was C89/C90 to C99. Again, most of it was new
> >> features that are not going to affect existing code unless you happen to
> >> use some of the new keywords as identifiers. But there are occasional
> >> differences, such as the types of some integer constants and possible
> >> differences in rounding for division with negative integers.
> >>
> >>
> >> If you have specific questions or code that you'd like help with,
> >> comp.lang.c is probably a better newsgroup.
> >
> > Thank you David!
> >
> > So, I can just change "-std" option of gcc and C program will work better?
> >
> No, it will work exactly alike (baring these very few corner cases).
> You don't get the advantage of newer C standards unless you write code
> that uses them. And most of the benefits are about making it easier to
> write clearer and safer C code, there will normally be no effect on the
> speed, size or correctness of the resulting compiled code. C99 lets you
> write better source code than C90, it does not let you get better
> results from old code.

Okay. I understood.

Thank you very much!

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor