August 02, 2002 Re: debug and import | ||||
---|---|---|---|---|
| ||||
Posted in reply to Juarez Rudsatz | 1. You could use dynamic loading (using the ones from C), but that's not ideal. 2. I think D strips all the import code out it doesn't need, so simply write your own wrapper around printf, and then comment out printf when you don't needed it. (Does it also strip empty functions?) "Juarez Rudsatz" <juarez@nowhere.com> wrote in message news:Xns925DC44076579juarezcom@63.105.9.61... > "Walter" <walter@digitalmars.com> escreveu em news:aic9sp$d33$2@digitaldaemon.com: > > > Imported symbols into function scope can hide local symbols, making for hard to find bugs, especially if the symbol is added into string later. > > > > When I wrote this post I have in mind a simple problem : Attaching library > for debuging ( or logging ). > If import is not allowed in debug statement I will need another form of > doing this. > For example, I wanna "printf" out variable values in debug code but in the > release I dont need "c.stdio". This is a simple example, and, maybe, could > exists anothers more complex. > There are another form of doing this ? > > dmd -JR |
August 04, 2002 Re: debug and import | ||||
---|---|---|---|---|
| ||||
Posted in reply to Juarez Rudsatz | Yes, there's another way. debug works also around global declarations: debug { import foo; } void func() { } "Juarez Rudsatz" <juarez@nowhere.com> wrote in message news:Xns925DC44076579juarezcom@63.105.9.61... > "Walter" <walter@digitalmars.com> escreveu em news:aic9sp$d33$2@digitaldaemon.com: > > > Imported symbols into function scope can hide local symbols, making for hard to find bugs, especially if the symbol is added into string later. > > > > When I wrote this post I have in mind a simple problem : Attaching library > for debuging ( or logging ). > If import is not allowed in debug statement I will need another form of > doing this. > For example, I wanna "printf" out variable values in debug code but in the > release I dont need "c.stdio". This is a simple example, and, maybe, could > exists anothers more complex. > There are another form of doing this ? > > dmd -JR |
August 05, 2002 Re: debug and semantic | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russell Lewis | Russell Lewis <spamhole-2001-07-16@deming-os.org> wrote in news:3D49BAF5.5060703@deming-os.org: > Maybe we should have a compiler switch that, in addition to building executables for a specific version and debug level, would automatically also do semantic checks on the rest? I can imagine that I would use that often in my makefiles, particularly if I'm doing a debug build anyway. > After thinking a little bit, I have found this switch : -debug=9 But this dont works when debug is not a integer ( debug(someversion) ). |
August 05, 2002 Re: debug and semantic | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | "Walter" <walter@digitalmars.com> wrote in news:aic9so$d33$1@digitaldaemon.com: > 1) faster compilation No doubt! Lets say semantic analisis is 20% of total time, and debug code is 40% of total code, this give us 8% increase. > 2) such code may refer to symbols that do not exist because some debug/version library is missing And what about the version statement into debug statement? debug { someCheck(); version(debugLibraryPresent){ anotherCheck(); } } I know this appear to be redundant. But this solves (2). And the semantic analisis could be enabled without fear. > 3) such code may be works in progress that are not ready yet to be compiled > |
August 08, 2002 Re: debug and semantic | ||||
---|---|---|---|---|
| ||||
Posted in reply to Juarez Rudsatz | "Juarez Rudsatz" <juarez@nowhere.com> wrote in message news:Xns9261BD4C31778juarezcom@63.105.9.61... > After thinking a little bit, I have found this switch : -debug=9 > But this dont works when debug is not a integer ( debug(someversion) ). That should be: -debug=someversion |
August 08, 2002 Re: debug and semantic | ||||
---|---|---|---|---|
| ||||
Posted in reply to Juarez Rudsatz | "Juarez Rudsatz" <juarez@nowhere.com> wrote in message news:Xns9261BEFC44C45juarezcom@63.105.9.61... > And what about the version statement into debug statement? > > debug { > someCheck(); > version(debugLibraryPresent){ > anotherCheck(); > } > } > > I know this appear to be redundant. But this solves (2). And the semantic analisis could be enabled without fear. Yes, that could work. |
Copyright © 1999-2021 by the D Language Foundation