[Issue 2714] std.getopt erroneously splits arguments

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2714


and...@metalanguage.com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED




--- Comment #1 from and...@metalanguage.com  2009-03-06 19:17 ---
Thanks, that's been fixed in svn already. Unfortunately that can't be built
from source yet, but in the interim a Linux binary is to be found at
http://ssli.ee.washington.edu/~aalexand/d/rdmd (I also added a --main option)


-- 



[Issue 996] Error in doc on implicit conversion between pointer and array

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=996


s...@iname.com changed:

   What|Removed |Added

 CC||s...@iname.com
URL|http://www.digitalmars.com/d|http://www.digitalmars.com/d
   |/2.0/arrays.html|/1.0/arrays.html
  Component|DMD |www.digitalmars.com
   Keywords||rejects-valid
 OS/Version|Linux   |All
   Platform|PC  |All




--- Comment #3 from s...@iname.com  2009-03-06 18:56 ---
This bug is filed against a D1 version, so surely the URL given should be to
the D1 docs.  Also correcting platform and component.


-- 



[Issue 2714] New: std.getopt erroneously splits arguments

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2714

   Summary: std.getopt erroneously splits arguments
   Product: D
   Version: 2.025
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Phobos
AssignedTo: and...@metalanguage.com
ReportedBy: dhase...@gmail.com


When you try:
rdmd --eval='printf("Hello world\n");'

You get an error. rdmd tried compiling the string 'printf("Hello'.

Looking into this further, std.getopt explicitly ignores shell escaping.
There's no way to pass in an argument with spaces using std.getopt.

The fix is to eliminate lines 312 to 327 inclusive in std/getopt.d, and rely on
the shell to split the arguments properly.


-- 



[Issue 2713] New: Error resolving types with ? : and const

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2713

   Summary: Error resolving types with ? : and const
   Product: D
   Version: 2.025
  Platform: PC
   URL: http://www.digitalmars.com/webnews/newsgroups.php?art_gr
oup=digitalmars.D&article_id=85423
OS/Version: All
Status: NEW
  Keywords: rejects-valid
  Severity: minor
  Priority: P3
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: zildjoh...@gmail.com


The following fails to compile:

bool flag() {
bool left, right;
return true ? cast(const bool)left : cast(bool)right;
}

with the error "cannot implicitly convert expression (cast(int)left) of type
int to bool".  It seems to happen whenever the left and right sides differ in
const-ness or invariant-ness.

This becomes an issue when trying to write const-correct class functions which
return bool, for example:

class C {
private int mask;

private bool readyYet() const {return true;}

public bool ExtractStateBit() const {
return readyYet() ? (mask & 1) : false;
}
}


-- 



[Issue 2712] New: error with passing an array slot as another array length to new

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2712

   Summary: error with passing an array slot as another array length
to new
   Product: D
   Version: unspecified
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: and...@metalanguage.com


void foo(uint n, in uint[] x)
{
auto y = new uint[x[n]];
}

void main()
{
foo(new uint[10]);
}

Error: need size of rightmost array, not type x[n]


-- 



[Issue 2678] for loops are already assumed to terminate

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2678


s...@iname.com changed:

   What|Removed |Added

 CC||s...@iname.com




--- Comment #6 from s...@iname.com  2009-03-06 14:56 ---
That should equally generate an unreachable code warning.


-- 



[Issue 2711] -H produces bad headers files if function defintion is templated and have auto return value

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2711





--- Comment #1 from bary...@smp.if.uj.edu.pl  2009-03-06 11:46 ---
Simpler example (without templates):

# cat header2.d
auto c(int x) {
return 5;
}
# dmd -c -H header2.d
# cat header2.di
// D import file generated from 'header2.d'
 c(int x)
{
return 5;
}


-- 



[Issue 2574] std.c.stdio doesn't compile: va_list not defined!

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2574





--- Comment #1 from bary...@smp.if.uj.edu.pl  2009-03-06 11:40 ---
Please do something with it. This breaks lots of libraries.


-- 



[Issue 2711] New: -H produces bad headers files if function defintion is templated and have auto return value

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2711

   Summary: -H produces bad headers files if function defintion is
templated and have auto return value
   Product: D
   Version: unspecified
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: bary...@smp.if.uj.edu.pl


# cat header.d
auto c(T)(T x) {
return x;
}
# dmd -c -H header.d
# cat header.di
// D import file generated from 'header.d'
template c(T)
{
 c(T x)
{
return x;
}
}


Currenly std/math.d function abs in phobos have problem.


-- 



[Issue 2710] dmd2/src/druntime/src/../import/std/intrinsic.di misses pure and nothrow in signatures

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2710


bary...@smp.if.uj.edu.pl changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED
Summary|dmd2/src/druntime/src/../imp|dmd2/src/druntime/src/../imp
   |ort/std/intrinsic.di misses |ort/std/intrinsic.di misses
   |pure and nothrow in |pure and nothrow in
   |signatures  |signatures




--- Comment #1 from bary...@smp.if.uj.edu.pl  2009-03-06 10:56 ---
Ok, I think druntime version r107 solved this problem.


-- 



[Issue 2710] New: dmd2/src/druntime/src/../import/std/intrinsic.di misses pure and nothrow in signatures

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2710

   Summary: dmd2/src/druntime/src/../import/std/intrinsic.di misses
pure and nothrow in signatures
   Product: D
   Version: unspecified
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: bugzi...@digitalmars.com
ReportedBy: bary...@smp.if.uj.edu.pl


When compiling druntime with dmd2, gc/bacis/gcbits.d calls std.intrinsic.btr,
which signatures is in ../import/std/intrinsic.di compiler don't emit proper
code.

Considering that file src/dmd/toir.c have on line 380 signature
9intrinsic3btrFNbPkkZi and that inspecting object file of gcbits.o I concluded
that D compiler isn't emiting proper code because intrinsic.di had missing
"nothrow and pure" keywords in few places.

Druntime compiles (because there can be unresolved symbls), but then compiling
phobos' unittest fails (because it links against everything and fails to find
9intrinsic3btrFPkkZi (which is for DMD1, and defined nowhere).

Solution, edit ../import/std/intrinsic.di and ensure there are this signatures
(as in phobos sources).

nothrow:

pure nothrow int bsf( uint v );
pure nothrow int bsr( uint v );
pure nothrow int bt( const uint* p, uint bitnum );
pure uint bswap( uint v );


I also concluded that intrinsic.di wasn't generated automatically from phobos'
sources (-H switch), because dmd is generating proper (and much more compacted)
version of code. This is rationall because there is no source files for it
(intrinsic.d in phobos contains only declarations, but proper ones).


-- 



[Issue 2697] Cast of float function return to ulong or uint gives bogus value

2009-03-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2697





--- Comment #1 from ma...@pochta.ru  2009-03-06 04:39 ---
In D2:

float:  5.00
ulong:  0
long:   5
uint:   0
int:5
ushort: 5
short:  5
ubyte:  5
byte:   5
float:  5.00
ulong:  5
long:   5
uint:   5
int:5
ushort: 5
short:  5
ubyte:  5
byte:   5


--