Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #62347 > unrolled thread

Non-(sub)-standard C

Started byDavid Kleinecke <dkleinecke@gmail.com>
First post2015-05-20 08:56 -0700
Last post2015-05-20 19:27 -0700
Articles 6 on this page of 46 — 13 participants

Back to article view | Back to comp.lang.c


Contents

  Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-20 08:56 -0700
    Re: Non-(sub)-standard C Noob <root@127.0.0.1> - 2015-05-20 18:02 +0200
    Re: Non-(sub)-standard C rick.c.hodgin@gmail.com - 2015-05-20 09:20 -0700
    Re: Non-(sub)-standard C Les Cargill <lcargill99@comcast.com> - 2015-05-20 12:12 -0500
    Re: Non-(sub)-standard C Keith Thompson <kst-u@mib.org> - 2015-05-20 10:53 -0700
      Re: Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-21 09:44 -0700
        Re: Non-(sub)-standard C rick.c.hodgin@gmail.com - 2015-05-21 10:22 -0700
        Re: Non-(sub)-standard C Keith Thompson <kst-u@mib.org> - 2015-05-21 10:46 -0700
        Re: Non-(sub)-standard C Andrew Smallshaw <andrews@sdf.lonestar.org> - 2015-05-21 19:39 +0000
          Re: Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-22 10:13 -0700
            Re: Non-(sub)-standard C Keith Thompson <kst-u@mib.org> - 2015-05-22 14:02 -0700
              Re: Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-23 09:41 -0700
                Re: Non-(sub)-standard C Robert Wessel <robertwessel2@yahoo.com> - 2015-05-23 13:37 -0500
                Re: Non-(sub)-standard C Keith Thompson <kst-u@mib.org> - 2015-05-23 14:38 -0700
                  Re: Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-24 10:10 -0700
                    Re: Non-(sub)-standard C wpihughes@gmail.com - 2015-05-24 12:53 -0700
                    Re: Non-(sub)-standard C rick.c.hodgin@gmail.com - 2015-05-24 13:05 -0700
                      Re: Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-25 09:01 -0700
                        Re: Non-(sub)-standard C rick.c.hodgin@gmail.com - 2015-05-25 10:19 -0700
                          Re: Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-26 11:01 -0700
                            Re: Non-(sub)-standard C rick.c.hodgin@gmail.com - 2015-05-26 11:40 -0700
                              Re: Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-27 10:28 -0700
                                Re: Non-(sub)-standard C rick.c.hodgin@gmail.com - 2015-05-27 11:13 -0700
                                  Re: Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-28 12:20 -0700
                                    Re: Non-(sub)-standard C rick.c.hodgin@gmail.com - 2015-05-28 12:26 -0700
                                      Re: Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-29 10:12 -0700
                                        Re: Non-(sub)-standard C wpihughes@gmail.com - 2015-05-29 13:57 -0700
                        Re: Non-(sub)-standard C rick.c.hodgin@gmail.com - 2015-05-26 11:33 -0700
                    Re: Non-(sub)-standard C Keith Thompson <kst-u@mib.org> - 2015-05-24 14:03 -0700
                      Re: Non-(sub)-standard C Richard Heathfield <rjh@cpax.org.uk> - 2015-05-24 22:09 +0100
                        Re: Non-(sub)-standard C Ian Collins <ian-news@hotmail.com> - 2015-05-25 16:46 +1200
                          Re: Non-(sub)-standard C James Kuyper <jameskuyper@verizon.net> - 2015-05-25 00:55 -0400
                            Re: Non-(sub)-standard C Ian Collins <ian-news@hotmail.com> - 2015-05-25 18:08 +1200
                              Re: Non-(sub)-standard C Richard Heathfield <rjh@cpax.org.uk> - 2015-05-25 10:58 +0100
                                Re: Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-25 09:12 -0700
                              Re: Non-(sub)-standard C James Kuyper <jameskuyper@verizon.net> - 2015-05-25 18:40 -0400
                                Re: Non-(sub)-standard C Ian Collins <ian-news@hotmail.com> - 2015-05-26 11:14 +1200
                                  Re: Non-(sub)-standard C rick.c.hodgin@gmail.com - 2015-05-25 19:01 -0700
                                  Re: Non-(sub)-standard C James Kuyper <jameskuyper@verizon.net> - 2015-05-25 22:03 -0400
                          Re: Non-(sub)-standard C Richard Heathfield <rjh@cpax.org.uk> - 2015-05-25 10:40 +0100
                            Re: Non-(sub)-standard C Ian Collins <ian-news@hotmail.com> - 2015-05-25 22:50 +1200
                        Re: Non-(sub)-standard C David Brown <david.brown@hesbynett.no> - 2015-05-25 12:42 +0200
                          Re: Non-(sub)-standard C James Kuyper <jameskuyper@verizon.net> - 2015-05-25 19:00 -0400
                            Re: Non-(sub)-standard C David Brown <david.brown@hesbynett.no> - 2015-05-26 08:43 +0200
                      Re: Non-(sub)-standard C David Kleinecke <dkleinecke@gmail.com> - 2015-05-25 09:07 -0700
    Non-(sub)-standard C Chad <cdalten@gmail.com> - 2015-05-20 19:27 -0700

Page 3 of 3 — ← Prev page 1 2 [3]


#62595

FromIan Collins <ian-news@hotmail.com>
Date2015-05-25 22:50 +1200
Message-ID<csgd47F6r0eU2@mid.individual.net>
In reply to#62588
Richard Heathfield wrote:
> On 25/05/15 05:46, Ian Collins wrote:
>> Richard Heathfield wrote:
>>> On 24/05/15 22:03, Keith Thompson wrote:
> <snip>
>>>> You've never seen long long int in use?  Variable-length arrays?
>>>> Flexible array members?  <stdint.h>?  Compound literals?
>>>> Designated initializers?  "//" comments?  Mixed declarations and
>>>> statements within a block?  Math functions that take float or long
>>>> dobule arguments?  _Bool and bool?
>>>
>>> Of the above list, in production code I've seen // comments (notably in
>>> a math.h header, causing the (C90) implementation to diagnose its own
>>> code!), and I think that's all. Of course, comp.lang.c is another
>>> matter, but it is a very artificial code environment.
>>
>> So you've never worked in a POSIX environment or worked on a Unix or
>> Linux kernel?
>
> In C++, sure, but we were talking about C. Most of my C programming (not
> /quite/ all, but certainly most) is done in environments where
> portability matters a great deal.

Me too, but these days I'd have to go well out of my way to find a 
target without a C99 compiler..

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#62594

FromDavid Brown <david.brown@hesbynett.no>
Date2015-05-25 12:42 +0200
Message-ID<mjuu94$d1s$1@dont-email.me>
In reply to#62549
On 24/05/15 23:09, Richard Heathfield wrote:
> On 24/05/15 22:03, Keith Thompson wrote:
>> David Kleinecke <dkleinecke@gmail.com> writes:
>
> <snip>
>
>>> PS: I think `for (int i = 0; i < N; i ++)' is the only extension of
>>> C90 I have actually seen in use. I disagree with it for reasons far
>>> afield (I want to pull all declarations in a function - at any depth
>>> - up to the start of function body - in order to define them all as a
>>> struct).
>>
>> You've never seen long long int in use?  Variable-length arrays?
>> Flexible array members?  <stdint.h>?  Compound literals?
>> Designated initializers?  "//" comments?  Mixed declarations and
>> statements within a block?  Math functions that take float or long
>> dobule arguments?  _Bool and bool?
>
> Of the above list, in production code I've seen // comments (notably in
> a math.h header, causing the (C90) implementation to diagnose its own
> code!), and I think that's all. Of course, comp.lang.c is another
> matter, but it is a very artificial code environment.
>

Of the C99 features (helpfully listed by James in another thread), the 
ones I use in production code are:

inline
restrict
_Bool (as "bool" from <stdbool.h>)
unsigned long long int (as "uint64_t" from <stdint.h>)
removed implicit int
compound literals
designated initializers
// comments
remove implicit function declaration
mixed declarations and code
integer constant type rules
integer promotion rules
trailing comma allowed in enum declaration
return without expression not permitted in function that returns a
value (and vice versa)

Missing from his list, but essential for me:
<stdint.h>
<stdbool.h>

I hate going back to pre-C99, as I occasionally have to do when 
maintaining ancient code.


 From C11, the only feature I see as particularly useful is 
_Static_assert, and I already use macros for that in C99.  The other 
useful additions (anonymous structs and unions, alignment control, 
_Noreturn) are all available as extensions in gcc and a range of other 
compilers.  Putting them in the standards is nice, of course.

[toc] | [prev] | [next] | [standalone]


#62623

FromJames Kuyper <jameskuyper@verizon.net>
Date2015-05-25 19:00 -0400
Message-ID<mk09gb$oeu$1@dont-email.me>
In reply to#62594
On 05/25/2015 06:42 AM, David Brown wrote:
...
> Of the C99 features (helpfully listed by James in another thread), the 
> ones I use in production code are:
...
> Missing from his list, but essential for me:
> <stdint.h>
> <stdbool.h>

Since you read that message, you are probably aware of something that
the casual reader of your message might not be: in response to a comment
by David kleinecke, I was explicitly listing only changes that affected
section 6 of the C standard. The impact of those two changes was almost
entirely in section 7.
-- 
James Kuyper

[toc] | [prev] | [next] | [standalone]


#62627

FromDavid Brown <david.brown@hesbynett.no>
Date2015-05-26 08:43 +0200
Message-ID<mk14kp$4vf$1@dont-email.me>
In reply to#62623
On 26/05/15 01:00, James Kuyper wrote:
> On 05/25/2015 06:42 AM, David Brown wrote:
> ...
>> Of the C99 features (helpfully listed by James in another thread), the 
>> ones I use in production code are:
> ...
>> Missing from his list, but essential for me:
>> <stdint.h>
>> <stdbool.h>
> 
> Since you read that message, you are probably aware of something that
> the casual reader of your message might not be: in response to a comment
> by David kleinecke, I was explicitly listing only changes that affected
> section 6 of the C standard. The impact of those two changes was almost
> entirely in section 7.
> 

I didn't notice that when I went back to find your list, but that makes
sense of course - there are a number of changes to the library in
section 7, plus a few bits and pieces elsewhere, that you didn't list.
But these two headers are, I think, the only changes outside section 6
that I find important.

[toc] | [prev] | [next] | [standalone]


#62598

FromDavid Kleinecke <dkleinecke@gmail.com>
Date2015-05-25 09:07 -0700
Message-ID<5505f9f0-b4e8-443a-a8cc-8bc1fcd2c65b@googlegroups.com>
In reply to#62548
On Sunday, May 24, 2015 at 2:04:04 PM UTC-7, Keith Thompson wrote:
> David Kleinecke <dkleinecke@gmail.com> writes:
> > On Saturday, May 23, 2015 at 2:38:28 PM UTC-7, Keith Thompson wrote:
> [...]
> >> If you want a language that's free of features that exist only for
> >> backward compatibility, perhaps C is not the language for you.
> >  
> > I would retort: If you want a language stuffed with features, perhaps
> > C is not the language for you.
> 
> It's interesting that you didn't have anything to say about the
> rest of what I wrote.  One might assume that means you agree,
> but I won't make that assumption.
> 
> > PS: I think `for (int i = 0; i < N; i ++)' is the only extension of
> > C90 I have actually seen in use. I disagree with it for reasons far
> > afield (I want to pull all declarations in a function - at any depth
> > - up to the start of function body - in order to define them all as a 
> > struct).
> 
> You've never seen long long int in use?  Variable-length arrays?
> Flexible array members?  <stdint.h>?  Compound literals?
> Designated initializers?  "//" comments?  Mixed declarations and
> statements within a block?  Math functions that take float or long
> dobule arguments?  _Bool and bool?
> 
> -- 
> Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
> Working, but not speaking, for JetHead Development, Inc.
> "We must do something.  This is something.  Therefore, we must do this."
>     -- Antony Jay and Jonathan Lynn, "Yes Minister"

I admit I overlooked "//" comments. And I am unsure about mixed 
declarations and statements because I myself have written code like that -
before I decoded it was a bad idea. 

But as to the other features you mention - no. I am mostly reading code
from the GTK+ crowd and the like. 

[toc] | [prev] | [next] | [standalone]


#62376

FromChad <cdalten@gmail.com>
Date2015-05-20 19:27 -0700
Message-ID<b55d3420-e29d-4278-95e6-1a3a488f0c2f@googlegroups.com>
In reply to#62347
Hi

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.c


csiph-web