www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - readf() compiler error message weirdness (CTFE-related?)

reply David Nadlinger <see klickverbot.at> writes:
I have always been pleased to see improvements in compile time code 
execution possibilities, but today I hit what must be the weirdest DMD 
error message I've ever seen:

/usr/local/bin/../include/d2/std/format.d(434): Error: can only 
Applications Desktop Documents Downloads Library Movies Music Pictures 
Public Sites test.d a pointer, not a 'int'

To be honest, I have no idea how this happens, but somehow DMD picked up 
the contents of the directory the source file, test.d, resides in. It 
looks like this (note the missing ampersand):
———
import std.stdio;
void main() {
     int e;
     readf( "%d", e );
}
———

Any idea what on earth could be going on here?

David
Feb 06 2011
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 2/6/11 10:48 AM, David Nadlinger wrote:
 I have always been pleased to see improvements in compile time code
 execution possibilities, but today I hit what must be the weirdest DMD
 error message I've ever seen:

 /usr/local/bin/../include/d2/std/format.d(434): Error: can only
 Applications Desktop Documents Downloads Library Movies Music Pictures
 Public Sites test.d a pointer, not a 'int'

 To be honest, I have no idea how this happens, but somehow DMD picked up
 the contents of the directory the source file, test.d, resides in. It
 looks like this (note the missing ampersand):
 ———
 import std.stdio;
 void main() {
 int e;
 readf( "%d", e );
 }
 ———

 Any idea what on earth could be going on here?

 David
This is a major bug because it impacts privacy. Please file to bugzilla. Andrei
Feb 06 2011
prev sibling parent reply Andrew Wiley <debio264 gmail.com> writes:
On Sun, Feb 6, 2011 at 9:48 AM, David Nadlinger <see klickverbot.at> wrote:

 I have always been pleased to see improvements in compile time code
 execution possibilities, but today I hit what must be the weirdest DMD er=
ror
 message I've ever seen:

 /usr/local/bin/../include/d2/std/format.d(434): Error: can only
 Applications Desktop Documents Downloads Library Movies Music Pictures
 Public Sites test.d a pointer, not a 'int'

 To be honest, I have no idea how this happens, but somehow DMD picked up
 the contents of the directory the source file, test.d, resides in. It loo=
ks
 like this (note the missing ampersand):
 =97=97=97
 import std.stdio;
 void main() {
    int e;
    readf( "%d", e );
 }
 =97=97=97

 Any idea what on earth could be going on here?

 David
On 64 bit linux (Arch, running dmd on a multilib installation), I get "/usr/include/d/std/format.d(428): Error: can only * a pointer, not a 'int'= " It almost seems like something is expanding the * syntax in your shell?
Feb 06 2011
parent David Nadlinger <see klickverbot.at> writes:
On 2/6/11 8:13 PM, Andrew Wiley wrote:
 On 64 bit linux (Arch, running dmd on a multilib installation), I get
 "/usr/include/d/std/format.d(428): Error: can only * a pointer, not a 'int'"
 It almost seems like something is expanding the * syntax in your shell?
This seems way more likely than something in DMD going wild, and that's precisely the reason I asked here first before opening a bug report. The idea that it could have something to do with compile-time code execution only came to my mind because I stumbled over this while trying to trace down a CTFE-related issue anyway… I'll investigate what's expanding the star and open a bug if this really has something to do with DMD against all odds. David
Feb 06 2011