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


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

Dropping C

Started bybartc <bc@freeuk.com>
First post2018-03-17 16:07 +0000
Last post2018-03-21 12:19 +0000
Articles 20 on this page of 125 — 24 participants

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


Contents

  Dropping C bartc <bc@freeuk.com> - 2018-03-17 16:07 +0000
    Re: Dropping C "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2018-03-18 00:41 +0800
    Re: Dropping C Richard Damon <Richard@Damon-Family.org> - 2018-03-17 19:54 -0400
      Re: Dropping C Ian Collins <ian-news@hotmail.com> - 2018-03-18 13:19 +1300
        Re: Dropping C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-03-18 02:42 -0700
      Re: Dropping C bartc <bc@freeuk.com> - 2018-03-18 01:28 +0000
        Re: Dropping C Richard Damon <Richard@Damon-Family.org> - 2018-03-17 21:41 -0400
          Re: Dropping C bartc <bc@freeuk.com> - 2018-03-18 11:25 +0000
            Re: Dropping C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-03-18 04:33 -0700
            Re: Dropping C jacobnavia <jacob@jacob.remcomp.fr> - 2018-03-19 00:05 +0100
              Re: Dropping C bartc <bc@freeuk.com> - 2018-03-19 00:24 +0000
                Re: Dropping C Richard Damon <Richard@Damon-Family.org> - 2018-03-18 21:15 -0400
                  Re: Dropping C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-03-18 19:00 -0700
                  Re: Dropping C David Brown <david.brown@hesbynett.no> - 2018-03-19 14:04 +0100
                    Re: Dropping C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-03-19 06:08 -0700
                    Re: Dropping C supercat@casperkitty.com - 2018-03-19 14:29 -0700
                Re: Dropping C Noob <root@127.0.0.1> - 2018-03-19 14:34 +0100
                  Re: Dropping C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-03-19 06:39 -0700
                  Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-19 15:17 +0100
                    Re: Dropping C bartc <bc@freeuk.com> - 2018-03-19 15:03 +0000
                      Re: Dropping C scott@slp53.sl.home (Scott Lurndal) - 2018-03-19 15:36 +0000
                        Re: Dropping C bartc <bc@freeuk.com> - 2018-03-19 17:01 +0000
                          Re: Dropping C Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2018-03-19 12:14 -0600
                            Re: Dropping C bartc <bc@freeuk.com> - 2018-03-19 19:15 +0000
                              Re: Dropping C Ian Collins <ian-news@hotmail.com> - 2018-03-20 08:20 +1300
                                Re: Dropping C bartc <bc@freeuk.com> - 2018-03-19 20:47 +0000
                                  Re: Dropping C Lowell Gilbert <lgusenet@be-well.ilk.org> - 2018-03-19 18:00 -0400
                                    Re: Dropping C bartc <bc@freeuk.com> - 2018-03-19 22:17 +0000
                                      Re: Dropping C Reinhardt Behm <rbehm@hushmail.com> - 2018-03-20 09:34 +0800
                                      Re: Dropping C jacobnavia <jacob@jacob.remcomp.fr> - 2018-03-21 07:54 +0100
                                        Re: Dropping C Robert Wessel <robertwessel2@yahoo.com> - 2018-03-21 04:10 -0500
                                          Re: Dropping C bartc <bc@freeuk.com> - 2018-03-21 11:08 +0000
                                            Re: Dropping C bartc <bc@freeuk.com> - 2018-03-21 11:18 +0000
                                              Re: Dropping C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-03-21 05:28 -0700
                                        Re: Dropping C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-03-21 12:13 +0000
                                          Re: Dropping C bartc <bc@freeuk.com> - 2018-03-21 12:26 +0000
                                            Re: Dropping C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-03-21 15:55 +0000
                                          Re: Dropping C jacobnavia <jacob@jacob.remcomp.fr> - 2018-03-21 20:15 +0100
                                            Re: Dropping C Keith Thompson <kst-u@mib.org> - 2018-03-21 12:45 -0700
                                              Re: Dropping C supercat@casperkitty.com - 2018-03-21 13:46 -0700
                                              Killfiles (Was: Dropping C) gazelle@shell.xmission.com (Kenny McCormack) - 2018-03-21 21:42 +0000
                                                Re: Killfiles (Was: Dropping C) Steven Petruzzellis <frelwizzen@gmail.com> - 2018-03-22 04:22 -0700
                                            Re: Dropping C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-03-21 20:21 +0000
                                            Re: Dropping C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-03-21 22:21 -0700
                                    Re: Dropping C Reinhardt Behm <rbehm@hushmail.com> - 2018-03-20 09:32 +0800
                                Re: Dropping C Ian Collins <ian-news@hotmail.com> - 2018-03-21 10:01 +1300
                                  Re: Dropping C luser droog <luser.droog@gmail.com> - 2018-03-20 16:01 -0700
                              Re: Dropping C Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2018-03-19 13:41 -0600
                              Re: Dropping C luser droog <luser.droog@gmail.com> - 2018-03-19 12:52 -0700
                              Re: Dropping C Spiros Bousbouras <spibou@gmail.com> - 2018-03-19 20:15 +0000
                              Re: Dropping C scott@slp53.sl.home (Scott Lurndal) - 2018-03-19 20:38 +0000
                                Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-19 22:00 +0100
                                  Re: Dropping C Spiros Bousbouras <spibou@gmail.com> - 2018-03-20 01:45 +0000
                                    Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-20 03:05 +0100
                                Re: Dropping C bartc <bc@freeuk.com> - 2018-03-19 21:09 +0000
                                  Re: Dropping C Ian Collins <ian-news@hotmail.com> - 2018-03-20 18:26 +1300
                                    Re: Dropping C bartc <bc@freeuk.com> - 2018-03-20 10:58 +0000
                                      Re: Dropping C David Brown <david.brown@hesbynett.no> - 2018-03-20 14:22 +0100
                                        Re: Dropping C scott@slp53.sl.home (Scott Lurndal) - 2018-03-20 13:58 +0000
                                          Re: Dropping C David Brown <david.brown@hesbynett.no> - 2018-03-20 17:14 +0100
                                          Re: Dropping C bartc <bc@freeuk.com> - 2018-03-20 16:31 +0000
                                            Re: Dropping C scott@slp53.sl.home (Scott Lurndal) - 2018-03-20 17:14 +0000
                                      Re: Dropping C Ian Collins <ian-news@hotmail.com> - 2018-03-21 07:31 +1300
                                        Re: Dropping C bartc <bc@freeuk.com> - 2018-03-20 18:51 +0000
                                          Re: Dropping C Ian Collins <ian-news@hotmail.com> - 2018-03-21 08:01 +1300
                                          Re: Dropping C scott@slp53.sl.home (Scott Lurndal) - 2018-03-20 19:03 +0000
                                            Re: Dropping C bartc <bc@freeuk.com> - 2018-03-20 19:22 +0000
                                              Re: Dropping C Ian Collins <ian-news@hotmail.com> - 2018-03-21 08:25 +1300
                                                Re: Dropping C bartc <bc@freeuk.com> - 2018-03-20 19:33 +0000
                                                  Re: Dropping C Ian Collins <ian-news@hotmail.com> - 2018-03-21 09:34 +1300
                                              Re: Dropping C scott@slp53.sl.home (Scott Lurndal) - 2018-03-20 19:49 +0000
                                            Re: Dropping C David Brown <david.brown@hesbynett.no> - 2018-03-21 11:27 +0100
                                Re: Dropping C Spiros Bousbouras <spibou@gmail.com> - 2018-03-20 01:27 +0000
                      Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-19 17:03 +0100
                        Re: Dropping C David Brown <david.brown@hesbynett.no> - 2018-03-19 23:13 +0100
                          Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-20 00:23 +0100
                        Re: Dropping C Spiros Bousbouras <spibou@gmail.com> - 2018-03-20 00:55 +0000
                          Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-20 02:29 +0100
                            Re: Dropping C Spiros Bousbouras <spibou@gmail.com> - 2018-03-20 02:04 +0000
                              Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-20 03:31 +0100
                            Re: Dropping C jacobnavia <jacob@jacob.remcomp.fr> - 2018-03-21 20:18 +0100
                              Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-21 21:32 +0100
                                Re: Dropping C scott@slp53.sl.home (Scott Lurndal) - 2018-03-21 20:52 +0000
                                  Re: Dropping C supercat@casperkitty.com - 2018-03-21 14:38 -0700
                                    Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-21 23:08 +0100
                                      Re: Dropping C Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-03-22 13:37 +0000
                                        Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-22 15:41 +0100
                                          Re: Dropping C bartc <bc@freeuk.com> - 2018-03-22 14:58 +0000
                                            Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-22 17:37 +0100
                                              Re: Dropping C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-03-22 17:09 +0000
                                                Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-22 18:27 +0100
                                                  Re: Dropping C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-03-22 17:35 +0000
                                                    Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-22 18:46 +0100
                                                      Re: Dropping C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-03-22 18:22 +0000
                                                        Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-22 19:38 +0100
                                                          Re: Dropping C jameskuyper@verizon.net - 2018-03-22 12:19 -0700
                                                          Re: Dropping C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-03-22 20:23 +0000
                                                          Re: Dropping C Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2018-03-23 06:10 -0700
                                                          Re: Dropping C David Brown <david.brown@hesbynett.no> - 2018-03-23 14:54 +0100
                                                            Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-23 16:55 +0100
                                                              Re: Dropping C David Brown <david.brown@hesbynett.no> - 2018-03-23 17:46 +0100
                                                        Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-24 02:50 +0100
                                                        Re: Dropping C GOTHIER Nathan <nathan.gothier@gmail.com> - 2018-03-24 02:54 +0100
                                            Re: Dropping C scott@slp53.sl.home (Scott Lurndal) - 2018-03-22 16:43 +0000
                                              Re: Dropping C Keith Thompson <kst-u@mib.org> - 2018-03-22 10:39 -0700
                                            Re: Dropping C Robert Wessel <robertwessel2@yahoo.com> - 2018-03-22 11:47 -0500
                                            Re: Dropping C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-03-24 00:59 -0700
                  Re: Dropping C bartc <bc@freeuk.com> - 2018-03-19 15:07 +0000
                    Re: Dropping C scott@slp53.sl.home (Scott Lurndal) - 2018-03-19 15:37 +0000
                      Re: Dropping C bartc <bc@freeuk.com> - 2018-03-19 17:16 +0000
                        Re: Dropping C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-03-19 20:30 +0000
                          Re: Dropping C bartc <bc@freeuk.com> - 2018-03-19 21:24 +0000
                            Re: Dropping C Ben Bacarisse <ben.usenet@bsb.me.uk> - 2018-03-19 23:06 +0000
                            Re: Dropping C Jorgen Grahn <grahn+nntp@snipabacken.se> - 2018-03-20 14:04 +0000
                        Re: Dropping C supercat@casperkitty.com - 2018-03-19 15:32 -0700
                          Re: Dropping C Robert Wessel <robertwessel2@yahoo.com> - 2018-03-19 19:03 -0500
                            Re: Dropping C Spiros Bousbouras <spibou@gmail.com> - 2018-03-20 02:13 +0000
                              Re: Dropping C David Brown <david.brown@hesbynett.no> - 2018-03-20 14:25 +0100
                          Re: Dropping C jacobnavia <jacob@jacob.remcomp.fr> - 2018-03-21 18:36 +0100
                        Re: Dropping C David Brown <david.brown@hesbynett.no> - 2018-03-19 23:33 +0100
                          Re: Dropping C supercat@casperkitty.com - 2018-03-19 16:34 -0700
                        Re: Dropping C asetofsymbols@gmail.com - 2018-03-20 00:58 -0700
                          Re: Dropping C Steven Petruzzellis <frelwizzen@gmail.com> - 2018-03-20 01:10 -0700
              Re: Dropping C Ian Collins <ian-news@hotmail.com> - 2018-03-19 14:25 +1300
    Re: Dropping C bartc <bc@freeuk.com> - 2018-03-21 12:19 +0000

Page 3 of 7 — ← Prev page 1 2 [3] 4 5 6 7  Next page →


#128179 — Killfiles (Was: Dropping C)

Fromgazelle@shell.xmission.com (Kenny McCormack)
Date2018-03-21 21:42 +0000
SubjectKillfiles (Was: Dropping C)
Message-ID<p8ujkn$5dp$2@news.xmission.com>
In reply to#128170
In article <lnfu4tp5zx.fsf@kst-u.example.com>,
Keith Thompson  <kst-u@mib.org> wrote:
...
>(jacob, if you see this, please acknowledge.  I suspect you've
>killfiled me, which of course you're free to do, but if so I'd like
>to know about it.)

This really isn't going to happen.  I mean, the whole point of killfiling
someone is to assert that they no longer exist (if they ever did...).

Surely, that's how you feel about me, given your claim that you've
killfiled me.  And surely, that is how Jacob would feel about you, if your
assumption about him is correct (but I don't think it is - see below).

Why would Jacob killfile you?  Why would anyone killfile you?

If (rhetorical) you don't enjoy reading Kiki's prattle, why even bother
with this newsgroup?

-- 
To most Christians, the Bible is like a software license. Nobody 
actually reads it. They just scroll to the bottom and click "I agree."

	- author unknown -

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


#128190 — Re: Killfiles (Was: Dropping C)

FromSteven Petruzzellis <frelwizzen@gmail.com>
Date2018-03-22 04:22 -0700
SubjectRe: Killfiles (Was: Dropping C)
Message-ID<e13a7c52-f626-4e33-9a4d-1923e4626829@googlegroups.com>
In reply to#128179
On Wednesday, March 21, 2018 at 2:42:57 PM UTC-7, Kenny McCormack wrote:
> In article <lnfu4tp5zx.fsf@kst-u.example.com>,
> Keith Thompson  <kst-u@mib.org> wrote:
> ...
> >(jacob, if you see this, please acknowledge.  I suspect you've
> >killfiled me, which of course you're free to do, but if so I'd like
> >to know about it.)
> 
> This really isn't going to happen.  I mean, the whole point of killfiling
> someone is to assert that they no longer exist (if they ever did...).
> 
> Surely, that's how you feel about me, given your claim that you've
> killfiled me.  And surely, that is how Jacob would feel about you, if your
> assumption about him is correct (but I don't think it is - see below).
> 
> Why would Jacob killfile you?  Why would anyone killfile you?
> 
> If (rhetorical) you don't enjoy reading Kiki's prattle, why even bother
> with this newsgroup?
> 
> -- 
> To most Christians, the Bible is like a software license. Nobody 
> actually reads it. They just scroll to the bottom and click "I agree."
> 
> 	- author unknown -



Savageduck wants to punish us: If he can't be the focus here then no one will. 

This is undoubtedly a joy of Savageduck's. 

Now Vennie Bowden on the other end of the line doesn't matter. All that matters is Savageduck gets to deliver the attack. So how to deal with this? Don't pay attention the phone. Reason isn't part of ploy and never will be. 

After ignoring all the trolling, it's basically just two flooders mass producing the preponderance of the barrage. Crystal clear. And both utterly over-the-top drug addicts. I often squash Savageduck with my brain. 

Savageduck doesn't have any concept of what he is crying about. 

-- 
One Smart Penny!!
https://youtu.be/D_so1dvjeyI
Jonas Eklundh Communication

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


#128171

FromBen Bacarisse <ben.usenet@bsb.me.uk>
Date2018-03-21 20:21 +0000
Message-ID<87o9jhrxha.fsf@bsb.me.uk>
In reply to#128168
jacobnavia <jacob@jacob.remcomp.fr> writes:

> Le 21/03/2018 à 13:13, Ben Bacarisse a écrit :
>> jacobnavia <jacob@jacob.remcomp.fr> writes:
>>
>>> Le 19/03/2018 à 23:17, bartc a écrit :
>>>> At the same time, C has the ability to make function definitions even
>>>> harder to see, by having a busy syntax indistinguishable at a glance
>>>> from a variable declaration;
>>>
>>> I published this algorithm in this group around 10 years ago:
>>>
>>> 1) Eliminate strings
>>> 2) Eliminate comments
>>> 3) Count braces
>>> 4) If at level zero you find a sequence of a right paren ')' followed
>>> by an opening brace '{', you have found the start of a function.
>>
>> You have to eliminate character literals as well (e.g. '{').  Even so,
>> neither of these will be found:
>>
>>    int (f(int x)) { return x; }
>
> The parentheses level is not zero in the inner scope. It will be found
> since at the global level (parentheses level zero) there is a clear
> 'à' followed by '{'

Yes, sorry, I was thinking about something else (finding the name).

>>    int g(x) int x; { return x; }
>>
>
> This is no longer supported since C89..

It's valid in C99 and C11.

>> and this
>>
>>   int *p = (int[]){0};
>>
>> will result in a false positive.
>
> Normally that would be int *p=NULL;

That's not the same thing.  (int[]){0} is an array typed lvalue
expression that converts to a non-null pointer.  Anyway, the point was
that all file-scope compound literals have the "){" pattern.

>> In addition to the complication caused by macros (at the very least they
>> can mess up the brace count) you have things like this to contend with:
>>       int h(int x) { return x; %>
>>    int i(int x) ??< return x; }
>
> Trigraphs aren't supported.

Note that only one of these two uses trigraphs.  The other uses the
alternate punctuators.

Not supporting trigraphs is fine (in fact it's probably a net gain for
programmers these days) but they are part of C and the original post was
about how hard it is to find a function definitions in C so it is part
of the complexity being discussed.

>> The simplest way to deal with macros, alternate punctuators and
>> trigraphs is probably just to pre-process the source.  But then your
>> algorithm needs to know how the pre-processor tracks file inclusion
>> because functions defined in header files should probably not be found
>> by this algorithm.
>
> The algorithm finds all functions in the compilation unit.

How do you deal with macros?

I need to make another correction.  Pre-processing will deal with
trigraphs but the newer alternate puctuators are not handled that early
in the translation.

-- 
Ben.

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


#128185

FromSteven Petruzzellis <frelwizzen@gmail.com>
Date2018-03-21 22:21 -0700
Message-ID<473124e8-3a86-4500-a15c-ce5ad639eaaf@googlegroups.com>
In reply to#128168
On Wednesday, March 21, 2018 at 12:15:36 PM UTC-7, jacobnavia wrote:
> Le 21/03/2018 à 13:13, Ben Bacarisse a écrit :
> > jacobnavia <jacob@jacob.remcomp.fr> writes:
> > 
> >> Le 19/03/2018 à 23:17, bartc a écrit :
> >>> At the same time, C has the ability to make function definitions even
> >>> harder to see, by having a busy syntax indistinguishable at a glance
> >>> from a variable declaration;
> >>
> >> I published this algorithm in this group around 10 years ago:
> >>
> >> 1) Eliminate strings
> >> 2) Eliminate comments
> >> 3) Count braces
> >> 4) If at level zero you find a sequence of a right paren ')' followed
> >> by an opening brace '{', you have found the start of a function.
> > 
> > You have to eliminate character literals as well (e.g. '{').  Even so,
> > neither of these will be found:
> > 
> >    int (f(int x)) { return x; }
> 
> The parentheses level is not zero in the inner scope. It will be found 
> since at the global level (parentheses level zero) there is a clear 'à' 
> followed by '{'
> 
> 
> >    int g(x) int x; { return x; }
> > 
> 
> This is no longer supported since C89...
> 
> > and this
> > 
> >   int *p = (int[]){0};
> >
> > will result in a false positive.
> > 
> 
> Normally that would be int *p=NULL;
> 
> > In addition to the complication caused by macros (at the very least they
> > can mess up the brace count) you have things like this to contend with:
> >    
> >    int h(int x) { return x; %>
> >    int i(int x) ??< return x; }
> >
> 
> Trigraphs aren't supported.
> 
> 
> > The simplest way to deal with macros, alternate punctuators and
> > trigraphs is probably just to pre-process the source.  But then your
> > algorithm needs to know how the pre-processor tracks file inclusion
> > because functions defined in header files should probably not be found
> > by this algorithm.
> > 
> 
> The algorithm finds all functions in the compilation unit.



What do you get out of lying? 

Did he think that was clever? 

Does Flatfish believe the nonsense Audra Moore is pushing? 

Too much glue for you, Gluey. Audra Moore wants to punish the whole group: If Audra Moore can't have dominate conversations here then his flooding crap will. 

You refuse to take culpability for your own posts. Quotes that are easily seen to be trolling. Just nonsense from him. But he has thoroughly left technology behind and is merely holding me culpable for the exploits of himself. 

-- 
I Left My Husband & Daughter At Home And THIS happened
http://www.5z8.info/hackwebcam_e9z2tw_friendster-of-sex
http://tinyurl.com/proof-about-ebot
https://www.facebook.com/profile.php?id=100012978552519
Jonas Eklundh Communication AB

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


#128064

FromReinhardt Behm <rbehm@hushmail.com>
Date2018-03-20 09:32 +0800
Message-ID<p8poc9$mel$1@dont-email.me>
In reply to#128040
AT Tuesday 20 March 2018 06:00, Lowell Gilbert wrote:

> bartc <bc@freeuk.com> writes:
> 
>> OK, that's what I thought. A general editor won't do it, not unless
>> you rope in the services of a separate program (a complicated one by
>> the sound of it) to do all the work, which also sounds like it has to
>> thoroughly understand and half-compile C source code.
>>
>> But an Editor plus Special Add-on doesn't equal General Purpose Editor.
>>
>> It's just another illustration of how C source syntax isn't really fit
>> for purpose, because of all these numerous add-on programs you have to
>> use to be able to work with it.
> 
> My preference is to look at the problem as a statement that a General
> Purpose Editor isn't fit for the purpose of editing source code beyond
> simple changes.
> 
> Are there other languages you consider to have this functionality of
> which you're bemoaning C's lack? Which ones did you have in mind?

If it is C, bartc will complain that you need a computer to use it.

-- 
Reinhardt

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


#128126

FromIan Collins <ian-news@hotmail.com>
Date2018-03-21 10:01 +1300
Message-ID<fhdb59Fa3iaU5@mid.individual.net>
In reply to#128021
On 03/20/2018 08:20 AM, Ian Collins wrote:
> 
> ctags and vi are almost as old as C...

The original vi (then called ex) source from 1977 can be found here:

http://minnie.tuhs.org/cgi-bin/utree.pl

Enter ex in the search box.

-- 
Ian.

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


#128127

Fromluser droog <luser.droog@gmail.com>
Date2018-03-20 16:01 -0700
Message-ID<10f56523-1bd2-4102-b9d0-2122a0cb184c@googlegroups.com>
In reply to#128126
On Tuesday, March 20, 2018 at 4:01:42 PM UTC-5, Ian Collins wrote:
> On 03/20/2018 08:20 AM, Ian Collins wrote:
> > 
> > ctags and vi are almost as old as C...
> 
> The original vi (then called ex) source from 1977 can be found here:
> 
> http://minnie.tuhs.org/cgi-bin/utree.pl
> 
> Enter ex in the search box.
> 

Wow. The madness starts even before main()!

http://minnie.tuhs.org/cgi-bin/utree.pl?file=1BSD/ex-1.1/ex.c :

#
/*
 * Ex - a text editor
 * Bill Joy UCB
 * Version 1.0 September, 1977
 */

#include "ex.h"
#include "ex_glob.h"

int	vyancnt;
char	endline	1;

/*
 * Ex uses a modified C runtime startup which allocates
 * and associated pointers for the "next" command.
 * The pointer G is initialized by this startup to point
 * to this area, and the pointer xargv0 and the counter
 * xargc0 are also initialized to point to the arguments.
 */
main()
{

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


#128023

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2018-03-19 13:41 -0600
Message-ID<1bfu4vyhs4.fsf@pfeifferfamily.net>
In reply to#128020
bartc <bc@freeuk.com> writes:

> On 19/03/2018 18:14, Joe Pfeiffer wrote:
>> bartc <bc@freeuk.com> writes:
>>
>>> On 19/03/2018 15:36, Scott Lurndal wrote:
>>>> bartc <bc@freeuk.com> writes:
>>>>
>>>>> BTW I've been meaning to ask this for a while: given an ordinary text
>>>>> editor, and given the name of a function, how do you find that function
>>>>> definition in a source file? I mean, going straight there rather then
>>>>> scanning a hundred other occurrences of the name before you get to the
>>>>> definition.
>>>>
>>>> With vim, you have the choice of  ctags or cscope databases
>>>> to allow direct access to the definition (e.g. with cscope or
>>>> ctags, <CTRL>-}
>>>> over an identifier will
>>>> go directly to the definition, even if it is in a different source file.
>>>> <CTRL>-T will return to the prior file/line.  The tag stack can be
>>>> arbitrarily
>>>> deep.
>>>>
>>>
>>> That'll work from a general editor? Like Notepad?
>>
>> Vim is, of course, a general editor.  If you meant to ask specifically
>> about Notepad, you should have said Notepad in the question.
>
> I obviously mean any editor that just edits text and knows nothing
> about ctags or cscopes or databases or identifiers.

It may have been obvious to you -- to me, the more powerful an editor is
the more appropriate it is to call it "general".

> (How would a function definition get into such a database anyway. You
> download a C project; does it come with such databases, or do you have
> to run some utilities first?)

No idea.  I've never had enough trouble locating my function definitions
to warrant doing anything extra to make it easier.  I'll frequently have
several windows open in an Emacs session, with one for the code I'm
currently editing and others with various .h files and the like.

> What I'm getting at is that there is no simple syntax form that can
> help ANY editor to trivially find any specific function. Or to not
> find it, if it exists outside of this source file.

If that's what you were getting at, you should have said so.

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


#128024

Fromluser droog <luser.droog@gmail.com>
Date2018-03-19 12:52 -0700
Message-ID<56b3095f-51b2-4b91-9116-2e33c3352d60@googlegroups.com>
In reply to#128020
On Monday, March 19, 2018 at 2:15:43 PM UTC-5, Bart wrote:
> 
> What I'm getting at is that there is no simple syntax form that can help 
> ANY editor to trivially find any specific function. Or to not find it, 
> if it exists outside of this source file.
> 

I often use grep for this.

$ grep myfunction *.[ch]

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


#128027

FromSpiros Bousbouras <spibou@gmail.com>
Date2018-03-19 20:15 +0000
Message-ID<HTUrC.242877$Ly1.9732@fx13.am4>
In reply to#128020
On Mon, 19 Mar 2018 19:15:35 +0000
bartc <bc@freeuk.com> wrote:
> On 19/03/2018 18:14, Joe Pfeiffer wrote:
> > bartc <bc@freeuk.com> writes:
> > 
> >> On 19/03/2018 15:36, Scott Lurndal wrote:
> >>> bartc <bc@freeuk.com> writes:
> >>>
> >>>> BTW I've been meaning to ask this for a while: given an ordinary text
> >>>> editor, and given the name of a function, how do you find that function
> >>>> definition in a source file? I mean, going straight there rather then
> >>>> scanning a hundred other occurrences of the name before you get to the
> >>>> definition.

Look into the documentation of your editor. If your editor does not give you
a way to do this then it's not appropriate for editing C source (it may still
be great for other purposes).

> >>> With vim, you have the choice of  ctags or cscope databases
> >>> to allow direct access to the definition (e.g. with cscope or ctags, <CTRL>-}
> >>> over an identifier will
> >>> go directly to the definition, even if it is in a different source file.
> >>> <CTRL>-T will return to the prior file/line.  The tag stack can be
> >>> arbitrarily
> >>> deep.
> >>>
> >>
> >> That'll work from a general editor? Like Notepad?

Even more importantly , if you're editing C source by doing
    cat > mysource.c
will it work for this ?

> > Vim is, of course, a general editor.  If you meant to ask specifically
> > about Notepad, you should have said Notepad in the question.
> 
> I obviously mean any editor that just edits text and knows nothing about 
> ctags or cscopes or databases or identifiers.
> 
> (How would a function definition get into such a database anyway. You 
> download a C project; does it come with such databases, or do you have 
> to run some utilities first?)

    ctags --c-kinds=+x --fields=fiKnszt  *.c *.h

in the directory of the project works for me. Of course , if the source
is spread over several directories then you'd need something more elaborate.

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


#128030

Fromscott@slp53.sl.home (Scott Lurndal)
Date2018-03-19 20:38 +0000
Message-ID<xdVrC.13912$qM7.9295@fx29.iad>
In reply to#128020
bartc <bc@freeuk.com> writes:
>On 19/03/2018 18:14, Joe Pfeiffer wrote:
>> bartc <bc@freeuk.com> writes:
>> 
>>> On 19/03/2018 15:36, Scott Lurndal wrote:
>>>> bartc <bc@freeuk.com> writes:
>>>>
>>>>> BTW I've been meaning to ask this for a while: given an ordinary text
>>>>> editor, and given the name of a function, how do you find that function
>>>>> definition in a source file? I mean, going straight there rather then
>>>>> scanning a hundred other occurrences of the name before you get to the
>>>>> definition.
>>>>
>>>> With vim, you have the choice of  ctags or cscope databases
>>>> to allow direct access to the definition (e.g. with cscope or ctags, <CTRL>-}
>>>> over an identifier will
>>>> go directly to the definition, even if it is in a different source file.
>>>> <CTRL>-T will return to the prior file/line.  The tag stack can be
>>>> arbitrarily
>>>> deep.
>>>>
>>>
>>> That'll work from a general editor? Like Notepad?
>> 
>> Vim is, of course, a general editor.  If you meant to ask specifically
>> about Notepad, you should have said Notepad in the question.
>
>I obviously mean any editor that just edits text and knows nothing about 
>ctags or cscopes or databases or identifiers.

Well, leaving aside how dumb that is....

Bell Labs and USL software written in C followed certain
conventions to make it easier to use the "editor" (vi, not vim).

A typical function would be coded as:

return-type
function-name(parameters...)
{
   body
}

This allowed certain keystroke sequences to find certain things.

For example, to find the function definition, one would simply
search for the function name at the beginning of the line. (/^function-name
in vi).

To move the cursor to the start of the function, hit [[ twice and
it will  move the cursor to a prior line that had the '{' as the
first character on the line, while ]] will move the cursor to the
first line (opening brace)  of the next function.

Unix, SVR4 and Unixware all followed this convention.

It really pissed me off that Linus wasn't aware of this simple
convention and consequently the opensource world prefers 'return-type function(...) {'

>
>(How would a function definition get into such a database anyway. You 
>download a C project; does it come with such databases, or do you have 
>to run some utilities first?)

One runs utilities, of course.   This isn't winblows where every program
has to do everything itself.


>What I'm getting at is that there is no simple syntax form that can help 
>ANY editor to trivially find any specific function.

Really, who cares?   Variety is the spice of life.

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


#128033

FromGOTHIER Nathan <nathan.gothier@gmail.com>
Date2018-03-19 22:00 +0100
Message-ID<20180319220033.62f9e086d28be09aba8daa73@gmail.com>
In reply to#128030
On Mon, 19 Mar 2018 20:38:53 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:

> Unix, SVR4 and Unixware all followed this convention.
> 
> It really pissed me off that Linus wasn't aware of this simple
> convention and consequently the opensource world prefers 'return-type
> function(...) {'

FWIW I've only seen this convention here... from your code. You should
complain to Dennis RITCHIE for popularizing the "type-specifier
identifier" convention on the same line.

 
> Really, who cares?   Variety is the spice of life.

I agree, the majority of C programmers doesn't care about your
coding convention because it is semantically a bad convention.

-- 
GOTHIER Nathan

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


#128066

FromSpiros Bousbouras <spibou@gmail.com>
Date2018-03-20 01:45 +0000
Message-ID<9eq1cZKhskkYpsW9x3VTy8bF6qO4k@bongo-ra.co>
In reply to#128033
On Mon, 19 Mar 2018 22:00:33 +0100
GOTHIER Nathan <nathan.gothier@gmail.com> wrote:
> On Mon, 19 Mar 2018 20:38:53 GMT
> scott@slp53.sl.home (Scott Lurndal) wrote:
> 
> > Unix, SVR4 and Unixware all followed this convention.
> > 
> > It really pissed me off that Linus wasn't aware of this simple
> > convention and consequently the opensource world prefers 'return-type
> > function(...) {'
> 
> FWIW I've only seen this convention here... from your code.

I already mentioned  www.gnu.org/prep/standards/standards.html#Formatting
in  <weq1cZKhskkYpvW9x3VTy8bF6qO4k@bongo-ra.co> .The  less  pager uses
the convention

<TAB>return type
function name(... parameter names ...)
parameter types
{

I dislike this too.

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


#128068

FromGOTHIER Nathan <nathan.gothier@gmail.com>
Date2018-03-20 03:05 +0100
Message-ID<20180320030549.e8190c8307017b18e3b43fdc@gmail.com>
In reply to#128066
On Tue, 20 Mar 2018 01:45:19 GMT
Spiros Bousbouras <spibou@gmail.com> wrote:
 
> I already mentioned
> www.gnu.org/prep/standards/standards.html#Formatting in
> <weq1cZKhskkYpvW9x3VTy8bF6qO4k@bongo-ra.co> .The  less  pager uses
> the convention
> 
> <TAB>return type
> function name(... parameter names ...)
> parameter types
> {
> 
> I dislike this too.

Thanks. Now I remember why I never contributed to GNU projects :-)

-- 
GOTHIER Nathan

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


#128034

Frombartc <bc@freeuk.com>
Date2018-03-19 21:09 +0000
Message-ID<qGVrC.43909$Oy5.10390@fx11.am4>
In reply to#128030
On 19/03/2018 20:38, Scott Lurndal wrote:

>> I obviously mean any editor that just edits text and knows nothing about
>> ctags or cscopes or databases or identifiers.
> 
> Well, leaving aside how dumb that is....

I understand. You guys are obviously using a language so fantastically 
advanced that a mere 'editor' just won't do!

I've never used any such advanced editor, and don't remember it causing 
any problems whatsoever. (Anything was better than working with a 
hard-copy terminal.)

However, in those days function names in definitions were in upper case, 
so finding a function was particularly simple.

> Bell Labs and USL software written in C followed certain
> conventions to make it easier to use the "editor" (vi, not vim).
> 
> A typical function would be coded as:
> 
> return-type
> function-name(parameters...)
> {
>     body
> }
> 
> This allowed certain keystroke sequences to find certain things.
> 
> For example, to find the function definition, one would simply
> search for the function name at the beginning of the line. (/^function-name
> in vi).

So that relies on all function bodies being indented?

> It really pissed me off that Linus wasn't aware of this simple
> convention and consequently the opensource world prefers 'return-type function(...) {'

At least one thing even you don't like then!

-- 
bartc

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


#128076

FromIan Collins <ian-news@hotmail.com>
Date2018-03-20 18:26 +1300
Message-ID<fhbkbmF5omlU3@mid.individual.net>
In reply to#128034
On 03/20/2018 10:09 AM, bartc wrote:
> On 19/03/2018 20:38, Scott Lurndal wrote:
> 
>>> I obviously mean any editor that just edits text and knows nothing about
>>> ctags or cscopes or databases or identifiers.
>>
>> Well, leaving aside how dumb that is....
> 
> I understand. You guys are obviously using a language so fantastically
> advanced that a mere 'editor' just won't do!

vi is a "mere editor".  Can you use notepad over a serial connection?

-- 
Ian.

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


#128082

Frombartc <bc@freeuk.com>
Date2018-03-20 10:58 +0000
Message-ID<0P5sC.116875$my2.7763@fx16.am4>
In reply to#128076
On 20/03/2018 05:26, Ian Collins wrote:
> On 03/20/2018 10:09 AM, bartc wrote:
>> On 19/03/2018 20:38, Scott Lurndal wrote:
>>
>>>> I obviously mean any editor that just edits text and knows nothing 
>>>> about
>>>> ctags or cscopes or databases or identifiers.
>>>
>>> Well, leaving aside how dumb that is....
>>
>> I understand. You guys are obviously using a language so fantastically
>> advanced that a mere 'editor' just won't do!
> 
> vi is a "mere editor".

One that understands ctags and cscopes? Then it's not a mere editor. And 
if it doesn't, then it would be a dumb way of editing C source, 
according to Scott.

> Can you use notepad over a serial connection?

In what manner? What is at either end of the serial connection? And why 
is it relevant to editing programming source code?

When I run my own editor I can use it on anything that is accessible via 
my file system, or that has been made accessible (eg. run ftp first). I 
don't know what point you're trying to make other than some apparent 
superiority of vi over Notepad.

(I don't use Notepad, it's just a good example of a simple editor.)

-- 
bartc

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


#128091

FromDavid Brown <david.brown@hesbynett.no>
Date2018-03-20 14:22 +0100
Message-ID<p8r1up$vbb$1@dont-email.me>
In reply to#128082
On 20/03/18 11:58, bartc wrote:
> On 20/03/2018 05:26, Ian Collins wrote:
>> On 03/20/2018 10:09 AM, bartc wrote:
>>> On 19/03/2018 20:38, Scott Lurndal wrote:
>>>
>>>>> I obviously mean any editor that just edits text and knows nothing
>>>>> about
>>>>> ctags or cscopes or databases or identifiers.
>>>>
>>>> Well, leaving aside how dumb that is....
>>>
>>> I understand. You guys are obviously using a language so fantastically
>>> advanced that a mere 'editor' just won't do!
>>
>> vi is a "mere editor".
> 
> One that understands ctags and cscopes? Then it's not a mere editor. And
> if it doesn't, then it would be a dumb way of editing C source,
> according to Scott.
> 
>> Can you use notepad over a serial connection?
> 
> In what manner? What is at either end of the serial connection? And why
> is it relevant to editing programming source code?

It would be strange (in this century) to do a lot of code editing over a
serial connection or low-bandwidth network connection.  It is not a
criteria I would see as relevant for normal work.  I have had only one
occasion when I have had to do something like this, fixing a bug in some
code while I was on holiday (using ssh on my Android phone from the top
of a hill) - nano worked fine despite the low-speed connection, and of
course "make" to rebuild.  That would have been impossible with an IDE.

> 
> When I run my own editor I can use it on anything that is accessible via
> my file system, or that has been made accessible (eg. run ftp first). I
> don't know what point you're trying to make other than some apparent
> superiority of vi over Notepad.
> 

There is no need to stretch that far to find reasons to pick a different
text editor than Notepad.  It is not much more than an edit box in a
window.  It is occasionally convenient, but not for source code editing.

> (I don't use Notepad, it's just a good example of a simple editor.)
> 

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


#128096

Fromscott@slp53.sl.home (Scott Lurndal)
Date2018-03-20 13:58 +0000
Message-ID<8s8sC.49089$iJ5.43351@fx04.iad>
In reply to#128091
David Brown <david.brown@hesbynett.no> writes:
>On 20/03/18 11:58, bartc wrote:

>>> Can you use notepad over a serial connection?
>> 
>> In what manner? What is at either end of the serial connection? And why
>> is it relevant to editing programming source code?
>
>It would be strange (in this century) to do a lot of code editing over a
>serial connection or low-bandwidth network connection. 

That's my primary mode of work.  SSH (6mbps/700kbps DSL) to a server
in the office, tunnelling X back.   The low bandwidth uplink makes
anything other than Athena Widgets GUI applications terminally slow.  But
vim works great over SSH.  (gvim is a bit slower, due to the GTK overhead).

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


#128107

FromDavid Brown <david.brown@hesbynett.no>
Date2018-03-20 17:14 +0100
Message-ID<p8rc10$6ps$1@dont-email.me>
In reply to#128096
On 20/03/18 14:58, Scott Lurndal wrote:
> David Brown <david.brown@hesbynett.no> writes:
>> On 20/03/18 11:58, bartc wrote:
> 
>>>> Can you use notepad over a serial connection?
>>>
>>> In what manner? What is at either end of the serial connection? And why
>>> is it relevant to editing programming source code?
>>
>> It would be strange (in this century) to do a lot of code editing over a
>> serial connection or low-bandwidth network connection. 
> 
> That's my primary mode of work.  SSH (6mbps/700kbps DSL) to a server
> in the office, tunnelling X back.   The low bandwidth uplink makes
> anything other than Athena Widgets GUI applications terminally slow.  But
> vim works great over SSH.  (gvim is a bit slower, due to the GTK overhead).
> 

That sounds unnecessarily painful - but I guess it depends on the kind
of work.  I often work at home rather than the office, and usually
transfer files via a source code repository (git or svn), and edit and
compile locally.  If I have particular reason to want to keep the files
and the compilation on the remote machine, I sometimes use sshfs to
access the files - the IDE runs locally, but the files are all remote.

But I suppose you have your reasons for working that way.

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


Page 3 of 7 — ← Prev page 1 2 [3] 4 5 6 7  Next page →

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


csiph-web