digitalmars.D.learn - -profile
- Anthony Goins (6/6) Jun 07 2013 Compiling with -profile and without -release
- bearophile (6/7) Jun 07 2013 Looks like a little compiler bug. Please create a minimal example
- bearophile (8/9) Jun 07 2013 I am compiling this code with -profile, and I don't see errors:
- Anthony Goins (16/25) Jun 07 2013 okay found it
- Anthony Goins (4/35) Jun 07 2013 oops forgot to say
- bearophile (5/6) Jun 07 2013 Yes, it's worth a bug report in Bugzilla, it's a (small) Phobos
- Anthony Goins (11/17) Jun 07 2013 Thank you for all your help. Not just here but throughout the
- bearophile (8/15) Jun 07 2013 I think -profile and pre-conditions should not be correlated.
- bearophile (4/5) Jun 07 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10295
Compiling with -profile and without -release Gives the following error (not exactly but the best I can recall) balancedParens is not nothrow safe pure With -release and -profile all is fine. Builds fine without -profile. Simple question is why?
Jun 07 2013
Anthony Goins:Simple question is why?Looks like a little compiler bug. Please create a minimal example that shows the problem. If it's a real problem then it's for Bugzilla. Bye, bearophile
Jun 07 2013
Anthony Goins:Simple question is why?I am compiling this code with -profile, and I don't see errors: import std.string: balancedParens; void main() { assert(balancedParens("[[]]", '[', ']')); } Bye, bearophile
Jun 07 2013
On Friday, 7 June 2013 at 21:39:26 UTC, bearophile wrote:Anthony Goins:okay found it module profiletest; import std.path; void main() { assert(globMatch("foo.bar", "*")); } dmd -profile profiletest.d /usr/include/dmd/phobos/std/path.d(2187): Error: balancedParens is not nothrow /usr/include/dmd/phobos/std/path.d(2188): Error: balancedParens is not nothrow globMatch is safe pure nothrow balancedParens is not nothrow -release ignores contracts, right?Simple question is why?I am compiling this code with -profile, and I don't see errors: import std.string: balancedParens; void main() { assert(balancedParens("[[]]", '[', ']')); } Bye, bearophile
Jun 07 2013
On Friday, 7 June 2013 at 23:42:58 UTC, Anthony Goins wrote:On Friday, 7 June 2013 at 21:39:26 UTC, bearophile wrote:oops forgot to say balancedParens is called from the 'in' contract of globMatch. Is this even worth a bug report?Anthony Goins:okay found it module profiletest; import std.path; void main() { assert(globMatch("foo.bar", "*")); } dmd -profile profiletest.d /usr/include/dmd/phobos/std/path.d(2187): Error: balancedParens is not nothrow /usr/include/dmd/phobos/std/path.d(2188): Error: balancedParens is not nothrow globMatch is safe pure nothrow balancedParens is not nothrow -release ignores contracts, right?Simple question is why?I am compiling this code with -profile, and I don't see errors: import std.string: balancedParens; void main() { assert(balancedParens("[[]]", '[', ']')); } Bye, bearophile
Jun 07 2013
Anthony Goins:Is this even worth a bug report?Yes, it's worth a bug report in Bugzilla, it's a (small) Phobos Bug. I confirmed its presence. Bye, bearophile
Jun 07 2013
On Friday, 7 June 2013 at 23:57:37 UTC, bearophile wrote:Anthony Goins:Thank you for all your help. Not just here but throughout the forums. One more question though... What is the error here :) 1. dmd profiletest.d should fail because balancedParens is not nothrow even though it is called from a contract. 2. dmd -profile profiletest.d should succeed because nothrow, safe, pure don't apply to contractsIs this even worth a bug report?Yes, it's worth a bug report in Bugzilla, it's a (small) Phobos Bug. I confirmed its presence. Bye, bearophile
Jun 07 2013
Anthony Goins:What is the error here :) 1. dmd profiletest.d should fail because balancedParens is not nothrow even though it is called from a contract. 2. dmd -profile profiletest.d should succeed because nothrow, safe, pure don't apply to contractsI think -profile and pre-conditions should not be correlated. That's why I have reported this bug as a dmd bug instead just of a Phobos bug. I am not sure what's the right answer. I think the right answer is 1. Bye, bearophile
Jun 07 2013
Anthony Goins:Is this even worth a bug report?http://d.puremagic.com/issues/show_bug.cgi?id=10295 Bye, bearophile
Jun 07 2013