www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - -betterC not working

reply SrMordred <patric.dexheimer gmail.com> writes:
On Ubuntu:

//dub.json
{
    "name": "d_betterc",
    "dflags" : ["-betterC"]
}

//source/app.d
import std.stdio;
extern (C) int main(int argc, char** argv) {
     int[] x;
     writeln(x);
     return 0;
}

//cmd
dub run --config=application --arch=x86_64 --build=debug 
--compiler=dmd
//or
dmd -betterC source/app.d app.d


Both compiles and run. But it shouldnt.
What im doing wrong?

(I got another type of errors on windows, but can't replicate it 
right now)

DMD64 D Compiler v2.075.1
DUB version 1.4.1, built on Aug 10 2017
Aug 30
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Wednesday, 30 August 2017 at 22:18:07 UTC, SrMordred wrote:
 DMD64 D Compiler v2.075.1
-betterC as described recently is not yet released. https://dlang.org/changelog/2.076.0_pre.html is where it gets the new behavior, and that isn't scheduled for formal release until the end of the week. (it seriously bothers me that Walter has been advertising this so much when the little bit that is implemented isn't even released yet, and what is implemented is barely usable.) The betterC switch itself is not new, but it does virtually nothing until that latest prerelease compiler.
Aug 30
parent reply SrMordred <patric.dexheimer gmail.com> writes:
On Wednesday, 30 August 2017 at 22:45:27 UTC, Adam D. Ruppe wrote:
 On Wednesday, 30 August 2017 at 22:18:07 UTC, SrMordred wrote:
 DMD64 D Compiler v2.075.1
-betterC as described recently is not yet released. https://dlang.org/changelog/2.076.0_pre.html is where it gets the new behavior, and that isn't scheduled for formal release until the end of the week. (it seriously bothers me that Walter has been advertising this so much when the little bit that is implemented isn't even released yet, and what is implemented is barely usable.) The betterC switch itself is not new, but it does virtually nothing until that latest prerelease compiler.
ooops, little missed detail ;) At least its near.
Aug 30
parent reply SrMordred <patric.dexheimer gmail.com> writes:
On Wednesday, 30 August 2017 at 23:12:07 UTC, SrMordred wrote:
 On Wednesday, 30 August 2017 at 22:45:27 UTC, Adam D. Ruppe 
 wrote:
 On Wednesday, 30 August 2017 at 22:18:07 UTC, SrMordred wrote:
 DMD64 D Compiler v2.075.1
-betterC as described recently is not yet released. https://dlang.org/changelog/2.076.0_pre.html is where it gets the new behavior, and that isn't scheduled for formal release until the end of the week. (it seriously bothers me that Walter has been advertising this so much when the little bit that is implemented isn't even released yet, and what is implemented is barely usable.) The betterC switch itself is not new, but it does virtually nothing until that latest prerelease compiler.
ooops, little missed detail ;) At least its near.
Hello again. Downloaded last version. //fail at my example, so its working as intended dmd -betterC source/app.d app.d //compiles. so problem with dub only dub run --config=application --arch=x86_64 --build=debug --compiler=dmd
Sep 01
parent Azi Hassan <azi.hassan live.fr> writes:
On Friday, 1 September 2017 at 22:13:53 UTC, SrMordred wrote:
 On Wednesday, 30 August 2017 at 23:12:07 UTC, SrMordred wrote:
 On Wednesday, 30 August 2017 at 22:45:27 UTC, Adam D. Ruppe 
 wrote:
 On Wednesday, 30 August 2017 at 22:18:07 UTC, SrMordred wrote:
 DMD64 D Compiler v2.075.1
-betterC as described recently is not yet released. https://dlang.org/changelog/2.076.0_pre.html is where it gets the new behavior, and that isn't scheduled for formal release until the end of the week. (it seriously bothers me that Walter has been advertising this so much when the little bit that is implemented isn't even released yet, and what is implemented is barely usable.) The betterC switch itself is not new, but it does virtually nothing until that latest prerelease compiler.
ooops, little missed detail ;) At least its near.
Hello again. Downloaded last version. //fail at my example, so its working as intended dmd -betterC source/app.d app.d //compiles. so problem with dub only dub run --config=application --arch=x86_64 --build=debug --compiler=dmd
Running dub run with --verbose indicates that dub is actually running both the "dmd -g -c -betterC source/app.d -ofd_betterc.o" and the "dmd -ofd_betterc d_betterc.o -g" commands. Note that the second dmd call doesn't include the -betterC flag. Running the second dmd command manually with the -betterC flag does give the expected undefined reference errors.
Sep 02