Why is `scope` planned for deprecation?
H. S. Teoh via Digitalmars-d
digitalmars-d at puremagic.com
Tue Nov 18 14:35:09 PST 2014
On Tue, Nov 18, 2014 at 02:14:20PM -0800, Walter Bright via Digitalmars-d wrote:
> On 11/18/2014 1:12 PM, H. S. Teoh via Digitalmars-d wrote:
> >On Tue, Nov 18, 2014 at 12:44:35PM -0800, Walter Bright via Digitalmars-d wrote:
> >>On 11/18/2014 12:10 PM, H. S. Teoh via Digitalmars-d wrote:
> >>>On Tue, Nov 18, 2014 at 11:45:13AM -0800, Walter Bright via Digitalmars-d wrote:
> >>>>I'm sorry to say this, but these rationalizations as to why C
> >>>>cannot add a trivial enhancement that takes nothing away and
> >>>>solves most of the buffer overflow problems leaves me shaking my
> >>>>head.
> >>>
> >>>What's the trivial thing that will solve most buffer overflow
> >>>problems?
> >>
> >>http://www.drdobbs.com/architecture-and-design/cs-biggest-mistake/228701625
> >
> >That's not a trivial change at all -- it will break pretty much every
> >C program there is out there. Just think of how much existing C code
> >relies on this conflation between arrays and pointers, and implicit
> >conversions between them.
>
> No, I proposed a new syntax that would have different behavior:
>
> void foo(char a[..])
Ah, I see. How would that be different from just declaring an array
struct and using it pervasively? Existing C code would not benefit from
such an addition without a lot of effort put into refactoring.
T
--
If you look at a thing nine hundred and ninety-nine times, you are perfectly safe; if you look at it the thousandth time, you are in frightful danger of seeing it for the first time. -- G. K. Chesterton
More information about the Digitalmars-d
mailing list