www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - broken: #line integer ["filespec"]

reply "Thomas Kuehne" <eisvogel users.sourceforge.net> writes:
special token "line":
 #line integer ["filespec"]\n

The documentation only states that the line number is an integer, but the implementation rejects negative integers. test case: svn://svn.kuehne.cn/dstress/run/line_token_01.d The filespec "" is accepted by both the documentation and the implementation but is treated as if no filespec was given. test case: svn://svn.kuehne.cn/dstress/run/line_token_03.d Even non-empty filespecs are ignored and instead the original filespec is used. test case: svn://svn.kuehne.cn/dstress/run/line_token_04.d Thomas
Oct 13 2004
parent reply Burton Radons <burton-radons smocky.com> writes:
Thomas Kuehne wrote:
 special token "line":
 
#line integer ["filespec"]\n

The documentation only states that the line number is an integer, but the implementation rejects negative integers. test case: svn://svn.kuehne.cn/dstress/run/line_token_01.d

It's defined as taking Integer, which is defined earlier in the lexical page. Integer literals are not signed. For CPP compatibility, it should take decimal digits only; for example, 019 to indicate 19: http://www.kuzbass.ru:8086/docs/isocpp/cpp.html#cpp.line (definition of digit-sequence): http://www.kuzbass.ru:8086/docs/isocpp/lex.html#lex.fcon In addition, string escapes are allowed in CPP: http://www.kuzbass.ru:8086/docs/isocpp/lex.html#lex.string
Oct 13 2004
parent reply "Thomas Kuehne" <eisvogel users.sourceforge.net> writes:
Burton Radons schrieb:
 It's defined as taking Integer, which is defined earlier in the lexical
 page.  Integer literals are not signed.

I think the signed issue was simply ommited from the documentation. If integer literals are un-signed then I don't know why the code below is accepted by the compiler. code: # # static int array[]=[-1,+2,-3]; # Thomas
Oct 14 2004
parent Stewart Gordon <smjg_1998 yahoo.com> writes:
Thomas Kuehne wrote:

<snip>
 I think the signed issue was simply ommited from the documentation.  
 If integer literals are un-signed then I don't know why the code 
 below is accepted by the compiler.
 
 code:
 #
 # static int array[]=[-1,+2,-3];

compile-time constant != literal Stewart.
Oct 14 2004