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:
--20cf3054a66b8351a5049ba1e849
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

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=

 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=

 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? --20cf3054a66b8351a5049ba1e849 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On Sun, Feb 6, 2011 at 9:48 AM, David Nadlinger = <span dir=3D"ltr">&lt;<a href=3D"mailto:see klickverbot.at">see klickverbot= .at</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"mar= gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> I have always been pleased to see improvements in compile time code executi= on possibilities, but today I hit what must be the weirdest DMD error messa= ge I&#39;ve ever seen:<br> <br> /usr/local/bin/../include/d2/std/format.d(434): Error: can only Application= s Desktop Documents Downloads Library Movies Music Pictures Public Sites te= st.d a pointer, not a &#39;int&#39;<br> <br> To be honest, I have no idea how this happens, but somehow DMD picked up th= e contents of the directory the source file, test.d, resides in. It looks l= ike this (note the missing ampersand):<br> =97=97=97<br> import std.stdio;<br> void main() {<br> =A0 =A0int e;<br> =A0 =A0readf( &quot;%d&quot;, e );<br> }<br> =97=97=97<br> <br> Any idea what on earth could be going on here?<br><font color=3D"#888888"> <br> David<br> </font></blockquote></div><br><div>On 64 bit linux (Arch, running dmd on a = multilib installation), I get &quot;/usr/include/d/std/format.d(428): Error= : can only * a pointer, not a &#39;int&#39;&quot;</div><div>It almost seems= like something is expanding the * syntax in your shell?</div> --20cf3054a66b8351a5049ba1e849--
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