D - HexadecimalH
- Alix Pexton <Alix thedjournal.com> Feb 22 2003
- Burton Radons <loth users.sourceforge.net> Feb 22 2003
- "Walter" <walter digitalmars.com> Feb 22 2003
- Alix Pexton <Alix thedjournal.com> Feb 23 2003
In the D specs ("lex.html" to be precise) there is a production thus:
HexadecimalH:
HexDigits h
HexDigits H
however the following code which should compile and run (printing
"3756") infact crashes the compiler (0.56):
int main(char[][] args){
printf("%d\n", each);
return 0;
}
If 'each' is first defined as an int and given a value, thus:
int main(char[][] args){
int each = 1;
printf("%d\n", each);
return 0;
}
then the code compiles and when run the program prints "1".
Meanwhile, an identifier that does not match the HexadecimalH
production, thus:
int main(char[][] args){
printf("%d\n", eachone);
return 0;
}
is correctly reported as being undefined.
HexadecimalH (in this case at least) seems to be broken.
Do we really need it???
Alix...
--
Alix Pexton
Webmaster - http://www.theDjournal.com
Alix theDjournal.com
Feb 22 2003
Alix Pexton wrote:In the D specs ("lex.html" to be precise) there is a production thus: HexadecimalH: HexDigits h HexDigits H
This should be: HexadecimalH: DecDigit h DecDigit H DecDigit HexDigits h DecDigit HexDigits Hhowever the following code which should compile and run (printing "3756") infact crashes the compiler (0.56): int main(char[][] args){ printf("%d\n", each); return 0; }
Err, it reports the correct error here on the same version.
Feb 22 2003
"Alix Pexton" <Alix thedjournal.com> wrote in message news:b3899j$1efj$1 digitaldaemon.com...HexadecimalH (in this case at least) seems to be broken. Do we really need it???
No, it should be removed from the doc. -Walter
Feb 22 2003
Walter wrote:"Alix Pexton" <Alix thedjournal.com> wrote in message news:b3899j$1efj$1 digitaldaemon.com...HexadecimalH (in this case at least) seems to be broken. Do we really need it???
No, it should be removed from the doc. -Walter
On-line syntax highlighting for "The D journal" just got easier... Alix... -- Alix Pexton Webmaster - http://www.theDjournal.com Alix theDjournal.com
Feb 23 2003









Burton Radons <loth users.sourceforge.net> 