Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #153066
| From | Manfred <noname@add.invalid> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: missing gcc attribute "overwritable" |
| Date | 2020-07-05 20:23 +0200 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <rdt5qo$1ugo$1@gioia.aioe.org> (permalink) |
| References | <caf83b9d-fb4a-46d4-81e5-28f28f3498e8o@googlegroups.com> <dfcd0fc5-141f-4132-a340-c0b2c41be7fbo@googlegroups.com> <cbc7dbde-4705-41ef-b4b0-d526b404ad95o@googlegroups.com> <91376443-615e-460c-839c-cf748a673a55o@googlegroups.com> <14058fdd-da38-491d-94ab-fb42e6c876a4o@googlegroups.com> |
On 7/5/2020 10:34 AM, aotto1968zwei@gmail.com wrote: > Am Freitag, 3. Juli 2020 09:38:02 UTC+2 schrieb aotto1...@gmail.com: >> Am Freitag, 3. Juli 2020 04:33:06 UTC+2 schrieb donal...@gmail.com: >>> On Thursday, July 2, 2020 at 1:56:33 PM UTC-4, aotto1...@gmail.com wrote: <snip> > After think about It, I come to the conclusion that it would be better to switch from: >> __attribute__((overwritable)) > to the keyword "overwrite". > 1. "overwrite" have to be applied to the OVERWRITING function and NOT to the > OVERWRITTEN function, this mean that OVERWRITABLE is the default. > 2. This correspond with the c# definition of "override" > In the google translate the "overwrite" and the "override" are both the > same, the German word "überschreiben" > 3. the "overwrite" will BREAK the c-syntax - NO compiler WITHOUT "overwrite" > feature will be able to translate this code > 4. the new keyword "overwrite" implicit "static". It appears you have changed the goal from manual adjustment of some generated library code to polymorphism - which is what the "override" keyword is about in C++ (and other languages including C#) There are very good reasons for which polymorphism is explicitly part of the OO design[*], and it applies only to member functions, not global (or static) functions. In fact, even in C polymorphism is typically implemented via function pointers inside some data structure (although C can have global function pointers as well). Back to the original point, IIUC this feature was supposed to "ease" the work of the programmer when adjusting some generated code. If so, you are envisioning an environment where you have some "bad" code generated by some tool, and "good" handwritten code that should replace the bad one - however, both the bad and the good code should survive in the product (otherwise there's no point in asking the compiler to replace anything). /If/ this is what this is about, my opinion is that it is not going to make anyone's life easier. [*] In fact when he first introduced virtual functions Stroustrup was criticized by some computer scientists at the time - the objection was that if the programmer does not know what some function does at the point of calling, then the software design is poor; the answer is that polymorphism does make sense in the context of object semantics. > > Example: <snip>
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar
missing gcc attribute "overwritable" aotto1968zwei@gmail.com - 2020-07-02 00:31 -0700
Re: missing gcc attribute "overwritable" mark.bluemel@gmail.com - 2020-07-02 01:38 -0700
Re: missing gcc attribute "overwritable" David Brown <david.brown@hesbynett.no> - 2020-07-02 12:03 +0200
Re: missing gcc attribute "overwritable" Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-07-02 06:18 -0700
Re: missing gcc attribute "overwritable" scott@slp53.sl.home (Scott Lurndal) - 2020-07-02 16:33 +0000
Re: missing gcc attribute "overwritable" aotto1968zwei@gmail.com - 2020-07-02 10:57 -0700
Re: missing gcc attribute "overwritable" Andrey Tarasevich <andreytarasevich@hotmail.com> - 2020-07-02 10:21 -0700
Re: missing gcc attribute "overwritable" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-07-02 10:42 -0700
Re: missing gcc attribute "overwritable" aotto1968zwei@gmail.com - 2020-07-02 10:56 -0700
Re: missing gcc attribute "overwritable" Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2020-07-02 11:33 -0700
Re: missing gcc attribute "overwritable" Bart <bc@freeuk.com> - 2020-07-02 19:53 +0100
Re: missing gcc attribute "overwritable" donalhambra@gmail.com - 2020-07-02 19:32 -0700
Re: missing gcc attribute "overwritable" mark.bluemel@gmail.com - 2020-07-03 00:30 -0700
Re: missing gcc attribute "overwritable" aotto1968zwei@gmail.com - 2020-07-03 00:36 -0700
Re: missing gcc attribute "overwritable" mark.bluemel@gmail.com - 2020-07-03 06:32 -0700
Re: missing gcc attribute "overwritable" mark.bluemel@gmail.com - 2020-07-03 07:08 -0700
Re: missing gcc attribute "overwritable" Tim Rentsch <tr.17687@z991.linuxsc.com> - 2020-07-09 10:02 -0700
Re: missing gcc attribute "overwritable" aotto1968zwei@gmail.com - 2020-07-03 00:37 -0700
Re: missing gcc attribute "overwritable" richard@cogsci.ed.ac.uk (Richard Tobin) - 2020-07-03 15:30 +0000
Re: missing gcc attribute "overwritable" The Real Non Homosexual <cdalten@gmail.com> - 2020-07-03 11:51 -0700
Re: missing gcc attribute "overwritable" richard@cogsci.ed.ac.uk (Richard Tobin) - 2020-07-03 19:48 +0000
Re: missing gcc attribute "overwritable" Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2020-07-03 14:20 -0700
Re: missing gcc attribute "overwritable" Richard Damon <Richard@Damon-Family.org> - 2020-07-03 20:37 -0400
Re: missing gcc attribute "overwritable" aotto1968zwei@gmail.com - 2020-07-05 01:34 -0700
Re: missing gcc attribute "overwritable" Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2020-07-05 09:45 -0400
Re: missing gcc attribute "overwritable" Manfred <noname@add.invalid> - 2020-07-05 20:23 +0200
Re: missing gcc attribute "overwritable" James Kuyper <jameskuyper@alumni.caltech.edu> - 2020-07-05 19:09 -0400
Re: missing gcc attribute "overwritable" gazelle@shell.xmission.com (Kenny McCormack) - 2020-07-05 23:37 +0000
Re: missing gcc attribute "overwritable" David Brown <david.brown@hesbynett.no> - 2020-07-06 08:27 +0200
csiph-web