[Issue 20244] New dmd option -preview=noXlinker does not work on Linux to build a simple D application

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20244

--- Comment #7 from alan.w.irwin1...@gmail.com ---
Hi Mike:

You had me going for a while. My comments on that collided with yours so I
abandoned mine, and I am just glad you were finally able to replicate the bug
(duplicate bad flag) I find now for the same configuration file that you are
using.  Also, for me the same ("flag flag" instead of "-Xlinker flag") bug
appears for me if I specify -L-Xlinker -L-flag on the command line.  Finally, I
notice JinShil has a one-line fix which I am about to test.

--


[Issue 20244] New dmd option -preview=noXlinker does not work on Linux to build a simple D application

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20244

--- Comment #6 from alan.w.irwin1...@gmail.com ---
Hi Mike:

You had me going for a while and my comments on that collided with yours so I
abandoned mine, and I am just glad you were finally able to replicate the bug!

--


[Issue 20244] New dmd option -preview=noXlinker does not work on Linux to build a simple D application

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20244

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #5 from Dlang Bot  ---
@JinShil created dlang/dmd pull request #10438 "Fix Issue 20244 - New dmd
option -preview=noXlinker does not work on Linux to build a simple D
application" fixing this issue:

- Fix Issue 20244 - New dmd option -preview=noXlinker does not work on Linux to
build a simple D application

https://github.com/dlang/dmd/pull/10438

--


[Issue 20244] New dmd option -preview=noXlinker does not work on Linux to build a simple D application

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20244

Mike Franklin  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |---

--- Comment #4 from Mike Franklin  ---
I'm sorry, but there is a bug in the implementation.

When you add `-L-Xlinker -L--export-dynamic` to the dmd.conf file or command
line, it actually appends `--export-dynamic --export-dynamic` instead of
`-Xlinker --export-dynamic` to the linker driver's command line.

I'll have a fix for it soon.

--


[Issue 6952] Static Linking on Linux

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6952
Issue 6952 depends on issue 20244, which changed state.

Issue 20244 Summary: New dmd option -preview=noXlinker does not work on Linux 
to build a simple D application
https://issues.dlang.org/show_bug.cgi?id=20244

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |---

--


[Issue 20244] New dmd option -preview=noXlinker does not work on Linux to build a simple D application

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20244

Mike Franklin  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--


[Issue 6952] Static Linking on Linux

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6952

Mike Franklin  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #12 from Mike Franklin  ---
That behavior is expected.  I've clarified in Issue 20244

--


[Issue 6952] Static Linking on Linux

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6952
Issue 6952 depends on issue 20244, which changed state.

Issue 20244 Summary: New dmd option -preview=noXlinker does not work on Linux 
to build a simple D application
https://issues.dlang.org/show_bug.cgi?id=20244

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |INVALID

--


[Issue 20244] New dmd option -preview=noXlinker does not work on Linux to build a simple D application

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20244

Mike Franklin  changed:

   What|Removed |Added

 CC||slavo5...@yahoo.com

--- Comment #3 from Mike Franklin  ---
That's correct.  The `--export-dynamic` option is coming from the config file. 
Therefore if you use `-preview=noXlinker` you'll need to compensate by adding
the `-Xlinker` argument to the dmd.conf file.

This dmd.conf file works for me when compiling with `-preview=noXlinker`

[Environment32]
DFLAGS=-I%@P%/../../../../../druntime/import -I%@P%/../../../../../phobos
-L-L%@P%/../../../../../phobos/generated/linux/release/32 -L-Xlinker
-L-L--export-dynamic

[Environment64]
DFLAGS=-I%@P%/../../../../../druntime/import -I%@P%/../../../../../phobos
-L-L%@P%/../../../../../phobos/generated/linux/release/64 -L-Xlinker
-L-L--export-dynamic -fPIC

--


[Issue 20244] New dmd option -preview=noXlinker does not work on Linux to build a simple D application

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20244

Mathias LANG  changed:

   What|Removed |Added

 CC||pro.mathias.l...@gmail.com

--- Comment #2 from Mathias LANG  ---
You might want to check the content of your config file
(/home/software/dmd/install/linux/bin64/dmd.conf). I'd wager the
"--export-dynamic" is there, in which case you can prevent it from being read
by using `-conf=''`.
Alternatively you can just modify your config file if you plan on always using
this option.

--


[Issue 20244] New dmd option -preview=noXlinker does not work on Linux to build a simple D application

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20244

alan.w.irwin1...@gmail.com changed:

   What|Removed |Added

 Blocks||6952


Referenced Issues:

https://issues.dlang.org/show_bug.cgi?id=6952
[Issue 6952] Static Linking on Linux
--


[Issue 6952] Static Linking on Linux

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6952

alan.w.irwin1...@gmail.com changed:

   What|Removed |Added

 Depends on||20244


Referenced Issues:

https://issues.dlang.org/show_bug.cgi?id=20244
[Issue 20244] New dmd option -preview=noXlinker does not work on Linux to build
a simple D application
--


[Issue 6952] Static Linking on Linux

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6952

alan.w.irwin1...@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||alan.w.irwin1...@gmail.com
 Resolution|FIXED   |---

--- Comment #11 from alan.w.irwin1...@gmail.com ---
It turns out the new feature in  does
not pass simple build tests of a "hello, world" example, see
.

--


[Issue 20244] New dmd option -preview=noXlinker does not work on Linux to build a simple D application

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20244

--- Comment #1 from alan.w.irwin1...@gmail.com ---
Further investigation showed this peculiar result

software@merlin> /home/software/dmd/install/linux/bin64/dmd -preview=noXlinker
main.d -L-Xlinker -L-Iwhatever -v |& tail -3
gcc main.o -o main -m64 -Iwhatever -Iwhatever --export-dynamic
-L/home/software/dmd/install/linux/bin64/../lib64 -Xlinker -Bstatic -lphobos2
-Xlinker -Bdynamic -lpthread -lm -lrt -ldl 
gcc: error: unrecognized command line option ‘--export-dynamic’; did you mean
‘-export-dynamic’?
Error: linker exited with status 1

Why does the gcc command generated by dmd have two -Iwhatever options rather
than what I expected which was -Xlinker -Iwhatever (which obviously would have
generated its own error by passing -Iwhatever to ld, but that is not the point
of this additional test).

--


[Issue 20244] New: New dmd option -preview=noXlinker does not work on Linux to build a simple D application

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20244

  Issue ID: 20244
   Summary: New dmd option -preview=noXlinker does not work on
Linux to build a simple D application
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: alan.w.irwin1...@gmail.com

I built dmd from git master branch HEAD today to evaluate this option, and
unfortunately it failed on my first test which was as follows:

software@merlin> cat >main.d
import std.stdio;
void main()
{
writeln("Hello, world without explicit compilations!");
}

Build and run the example without the -preview=noXlinker option to demonstrate
my built version of dmd is working correctly without this flag for this source
code

software@merlin> /home/software/dmd/install/linux/bin64/dmd main.d
software@merlin> ./main
Hello, world without explicit compilations!

Now attempt to build with the -preview=noXlinker option
software@merlin> /home/software/dmd/install/linux/bin64/dmd -preview=noXlinker
main.d
gcc: error: unrecognized command line option ‘--export-dynamic’; did you mean
‘-export-dynamic’?
Error: linker exited with status 1

Try again with more verbose output to see what the underlying gcc command is

software@merlin> /home/software/dmd/install/linux/bin64/dmd -preview=noXlinker
main.d -v
predefs   DigitalMars Posix linux ELFv1 CRuntime_Glibc CppRuntime_Gcc
LittleEndian D_Version2 all D_SIMD D_InlineAsm_X86_64 X86_64 D_LP64 D_PIC
assert D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat
binary/home/software/dmd/install/linux/bin64/dmd
version   v2.088.0-238-g73f37547d
config/home/software/dmd/install/linux/bin64/dmd.conf
DFLAGS-I/home/software/dmd/install/linux/bin64/../../src/phobos
-I/home/software/dmd/install/linux/bin64/../../src/druntime/import
-L-L/home/software/dmd/install/linux/bin64/../lib64 -L--export-dynamic -fPIC
parse main
importall main
importobject   
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/object.d)
importcore.internal.hash   
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/hash.d)
importcore.internal.traits 
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/traits.d)
importcore.internal.convert
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/convert.d)
importcore.internal.entrypoint 
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/entrypoint.d)
importcore.internal.array.appending
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/array/appending.d)
importcore.internal.array.comparison   
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/array/comparison.d)
importcore.internal.array.equality 
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/array/equality.d)
importcore.internal.array.casting  
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/array/casting.d)
importcore.internal.array.concatenation
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/array/concatenation.d)
importcore.internal.array.construction 
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/array/construction.d)
importcore.internal.array.capacity 
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/array/capacity.d)
importcore.internal.dassert
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/dassert.d)
importcore.internal.destruction
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/destruction.d)
importcore.internal.moving 
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/moving.d)
importcore.internal.postblit   
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/postblit.d)
importcore.internal.switch_
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/internal/switch_.d)
importstd.stdio
(/home/software/dmd/install/linux/bin64/../../src/phobos/std/stdio.d)
importcore.stdc.stddef 
(/home/software/dmd/install/linux/bin64/../../src/druntime/import/core/stdc/stddef.d)
importstd.algorithm.mutation   
(/home/software/dmd/install/linux/bin64/../../src/phobos/std/algorithm/mutation.d)
importstd.traits   
(/home/software/dmd/install/linux/bin64/../../src/phobos/std/traits.d)
importstd.meta 
(/home/software/dmd/install/linux/bin64/../../src/phobos/std/meta.d)
importstd.range.primitives 
(/home/software/dmd/install/linux/bin64/../../src/phobos/std/range/primitives.d)
importstd.functional   

[Issue 20239] chameleon zip-file should be rejected by std.zip

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20239

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #2 from Dlang Bot  ---
@crocopaw created dlang/phobos pull request #7198 "Fix issue 20239 - chameleon
zip-file should be rejected by std.zip" fixing this issue:

- Fix issue 20239 - chameleon zip-file should be rejected by std.zip

https://github.com/dlang/phobos/pull/7198

--


[Issue 20239] chameleon zip-file should be rejected by std.zip

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20239

--- Comment #1 from Berni  ---
I just learned, that this is called a chameleon file. The result depends on the
parser used. Such files should be rejected as they can be assumed to be
malware.

--


[Issue 20239] chameleon zip-file should be rejected by std.zip

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20239

Berni  changed:

   What|Removed |Added

Summary|wrong result when   |chameleon zip-file should
   |extracting with std.zip |be rejected by std.zip

--


[Issue 20243] New: inout not substituted for in associative array key type

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20243

  Issue ID: 20243
   Summary: inout not substituted for in associative array key
type
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: rightfold+bugzilla+dl...@gmail.com

DMD 2.87.

Example program:

// https://run.dlang.io/is/mIIhvc
void main()
{
inout(int) f(inout(int)[inout(string)] x);
const(int)[const(string)] x;
f(x);
}

Fails with error:

onlineapp.d(5): Error: function onlineapp.main.f(inout(int)[inout(string)] x)
is not callable using argument types (const(int)[const(string)])
onlineapp.d(5):cannot pass argument x of type const(int)[const(string)]
to parameter inout(int)[inout(string)] x

But I expect it to succeed, and substitute const for inout in the associative
array key type.

--


[Issue 20027] std.zip susceptible to zip malware attacks

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20027

Berni  changed:

   What|Removed |Added

 CC||dl...@croco-puzzle.com

--- Comment #2 from Berni  ---
Some of these rejections feel a little bit dubious. E.g. "Rejects ZIP64 version
2 (and ZIP64 version 1).". Do we want to support Zip64 or not? Same question
for multiple volumes and encryption.

Also, zip has been designed to contain unused data: When removing a file from
an archive, it can just be deleted from the central directory. From the view
point of data protection this is horrible, but it's still a correct zip file,
that should not be rejected by std.zip in my oppinion.

"Rejects compression methods other than 0 (uncompressed) or 8 (deflate)." - At
least 12 (bzip) might be an other candidate for decompression support in my
oppinion.

Others, like overlapping entries or invalid paths and so on, should of course
be rejected.

What do you think?

--


[Issue 18594] X is not an lvalue should have a better error message

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18594

Tobias Pankrath  changed:

   What|Removed |Added

 CC||tob...@pankrath.net

--- Comment #5 from Tobias Pankrath  ---
---
struct Test(T) {

@property ref T get() inout { return member; }

private:
   T member;
}


int main(string[] args)
{
   Test!int t;
   t.get = 12;
   return t.get;
}
---

This code has an very similar issue:

> test.d(3): Error: cast(int)this.member is not an lvalue and cannot be modified

The correct definition is:
---
struct Test(T) {

@property ref inout(T) get() inout { return member; }

private:
   T member;
}
---

but the error message gives no hint in that direction. It confused me quite a
bit, since IMO member is a fine lvalue that happens to be const/inout. 

https://run.dlang.io/is/IJKZ80

--


[Issue 20238] Add ability to specify ref argument for single-parameter lambdas without parentheses

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20238

anonymous4  changed:

   What|Removed |Added

   Keywords||spec
   Hardware|x86 |All
 OS|Mac OS X|All

--- Comment #1 from anonymous4  ---
Dunno, delegates already have quite overloaded and ambiguous syntax.

--


[Issue 20242] BitArray constructor should not modify input data

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20242

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@CyberShadow created dlang/phobos pull request #7194 "BitArray fixes" fixing
this issue:

- Fix Issue 20242 - BitArray constructor should not modify input data

https://github.com/dlang/phobos/pull/7194

--


[Issue 20241] BitArray.bitsSet ignores length

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20241

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@CyberShadow created dlang/phobos pull request #7194 "BitArray fixes" fixing
this issue:

- Fix Issue 20241 - BitArray.bitsSet ignores length

https://github.com/dlang/phobos/pull/7194

--


[Issue 20240] BitArray inconsistently preserves bits past length

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20240

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #1 from Dlang Bot  ---
@CyberShadow created dlang/phobos pull request #7194 "BitArray fixes" fixing
this issue:

- Fix Issue 20240 - BitArray inconsistently preserves bits past length

https://github.com/dlang/phobos/pull/7194

--


[Issue 20241] BitArray.bitsSet ignores length

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20241

Vladimir Panteleev  changed:

   What|Removed |Added

 Blocks||20242


Referenced Issues:

https://issues.dlang.org/show_bug.cgi?id=20242
[Issue 20242] BitArray constructor should not modify input data
--


[Issue 20242] New: BitArray constructor should not modify input data

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20242

  Issue ID: 20242
   Summary: BitArray constructor should not modify input data
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P4
 Component: phobos
  Assignee: dlang-bugzi...@thecybershadow.net
  Reporter: dlang-bugzi...@thecybershadow.net
Depends on: 20241

Currently BitArray.this has the peculiar behavior in that it modifies the data
referenced from its arguments to clear bits past the specified length. This is
documented with a big scary warning in its DDoc. However, I don't see why this
behavior is necessary for BitArray to work, as it should never be even
accessing bits past its designated length, and it stands in the way of some
BitArray applications (i.e. building multiple BitArrays from the same immutable
source data but with different length).


Referenced Issues:

https://issues.dlang.org/show_bug.cgi?id=20241
[Issue 20241] BitArray.bitsSet ignores length
--


[Issue 20241] New: BitArray.bitsSet ignores length

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20241

  Issue ID: 20241
   Summary: BitArray.bitsSet ignores length
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P4
 Component: phobos
  Assignee: dlang-bugzi...@thecybershadow.net
  Reporter: dlang-bugzi...@thecybershadow.net

 test.d 
import std.algorithm.comparison;
import std.bitmanip;

void main()
{
BitArray ba;
ba.length = 2;
ba[1] = 1;
ba.length = 1;
assert(ba.bitsSet.empty);
}


--


[Issue 20240] New: BitArray inconsistently preserves bits past length

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20240

  Issue ID: 20240
   Summary: BitArray inconsistently preserves bits past length
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P4
 Component: phobos
  Assignee: dlang-bugzi...@thecybershadow.net
  Reporter: dlang-bugzi...@thecybershadow.net

 test.d ///
import std.bitmanip;

void main()
{
BitArray ba;

ba.length = 1;
ba[0] = 1;
ba.length = 0;
ba.length = 1;
assert(ba[0] == 0); // OK

ba.length = 2;
ba[1] = 1;
ba.length = 1;
ba.length = 2;
assert(ba[1] == 0); // Fail
}
///

--


[Issue 20239] New: wrong result when extracting with std.zip

2019-09-25 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20239

  Issue ID: 20239
   Summary: wrong result when extracting with std.zip
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: dl...@croco-puzzle.com

Created attachment 1761
  --> https://issues.dlang.org/attachment.cgi?id=1761=edit
correct zip file, which is handled wrong by std.zip

The attached zip file is a correct zip file according to the specification
https://pkware.cachefly.net/webdocs/APPNOTE/APPNOTE-6.3.5.TXT

It contains a zipped file called "best_language" with content "D". But std.zip
will output "FORTRAN" instead. (By the way, linux tool unzip is tricked too,
gunzip not. I havn't tried other programs yet.)

The file contains a file comment at the end. std.zip detects inside this
comment a central directory and therefore misses the correct central directory.

--