[Issue 10150] Prefix method 'this' qualifiers should be just ignored anytime

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 30 11:52:05 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10150



--- Comment #12 from monarchdodra at gmail.com 2013-06-30 11:52:04 PDT ---
(In reply to comment #4)
> I disagree with this change, this is extremely dangerous behavior when
> interfacing with C. Take a look at the following:
> 
> -----
> extern(C) const int *foo();
> 
> void main()
> {
>     *foo() = 1;  // compiles
> }
> -----
> 
> The proper definition should have been:
> 
> -----
> extern(C) const(int)* foo();
> 
> void main()
> {
>     *foo() = 1;  // fails
> }
> -----
> 
> It is very easy to make this mistake, it should not be silent, at least not for
> module-scoped functions.
> 
> Alternatively as a compromise I suggest we at least add this check for
> extern(C) functions, because this is where this problem can occur very
> frequently.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list