www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 698] New: variadic arguments have a limit

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=698

           Summary: variadic arguments have a limit
           Product: D
           Version: 0.178
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: funisher gmail.com


... A small limit at that:

template LaLa(E...) {
        class LaLa {

        }
}

void main() {

        // works
        new LaLa!("lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala");

        // doesn't work
        new LaLa!("lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala",
                "lala", "lala", "lala", "lala");

        // doesn't work
        new
LaLa!("lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala",
               
"lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala");
}

both of those crash the compiler...


-- 
Dec 19 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=698


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com
           Keywords|                            |ice-on-valid-code




------- Comment #1 from smjg iname.com  2006-12-19 15:55 -------
DMD 0.178 hasn't been released.  Do you mean 0.177 by any chance?


-- 
Dec 19 2006
prev sibling next sibling parent "John Reimer" <terminal.node gmail.com> writes:
Is there some early release version of 0.178 going around?

Or was this supposed to refer to 0.177.


On Tue, 19 Dec 2006 07:43:43 -0800, <d-bugmail puremagic.com> wrote:

 http://d.puremagic.com/issues/show_bug.cgi?id=3D698

            Summary: variadic arguments have a limit
            Product: D
            Version: 0.178
           Platform: PC
         OS/Version: Linux
             Status: NEW
           Severity: normal
           Priority: P2
          Component: DMD
         AssignedTo: bugzilla digitalmars.com
         ReportedBy: funisher gmail.com


 ... A small limit at that:

 template LaLa(E...) {
         class LaLa {

         }
 }

 void main() {

         // works
         new LaLa!("lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala");

         // doesn't work
         new LaLa!("lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala");

         // doesn't work
         new
 LaLa!("lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalal=

alalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalal= alalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalal= alalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalal= alalalalalalalalalalalalalalalalalalalalalalalalalalalala",
 "lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalal=

alalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalal= alalalalalalalalalalalalalalalalala");
 }

 both of those crash the compiler...

Dec 19 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=698


funisher gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|0.178                       |0.177




------- Comment #2 from funisher gmail.com  2006-12-19 17:41 -------
yep, lol, I wasn't paying attention -- I just figured it was the last one on
the list


-- 
Dec 19 2006
prev sibling next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com schrieb am 2006-12-19:
 http://d.puremagic.com/issues/show_bug.cgi?id=698

 ... A small limit at that:

 template LaLa(E...) {
         class LaLa {

         }
 }

 void main() {

         // works
         new LaLa!("lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala");

         // doesn't work
         new LaLa!("lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala",
                 "lala", "lala", "lala", "lala");

         // doesn't work
         new
 LaLa!("lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala",
                
 "lalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalalala");
 }

 both of those crash the compiler...

This is most likely the identifier's size restriction of DMD triggered also by the following test cases: http://dstress.kuehne.cn/run/l/large_id_01_A.d http://dstress.kuehne.cn/run/l/large_id_01_C.d As a work-around you can use the GDC compiler(http://dgcc.sourceforge.net/). Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFkRkhLK5blCcjpWoRAsICAJwPSu+pBUsiYAeHD1l3ZFgz6mQp9wCgqPMW N0d5aQXD64D1xxi9T9CZBLw= =cj8a -----END PGP SIGNATURE-----
Dec 26 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=698





------- Comment #5 from funisher gmail.com  2006-12-28 18:03 -------
I'm running linux... let me know if you need me to compile a debug version of
dmd to get the backtrace

L3 ~ # dmd
Digital Mars D Compiler v0.178
[snipped]
L3 ~ # uname -a
Linux L3 2.6.18-no2 #7 SMP PREEMPT Wed Nov 8 21:08:35 Local time zone must be
set--s i686 Intel(R) Core(TM)2 CPU         T7200    2.00GHz GenuineIntel
GNU/Linux
L3 ~ # cat test.d 
[above code snipped]
L3 ~ # dmd test.d 
Segmentation fault

---------------------

(gdb) run test.d
Starting program: /usr/bin/dmd test.d
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

Program received signal SIGSEGV, Segmentation fault.
0x36313663 in ?? ()
(gdb) bt
#0  0x36313663 in ?? ()
#1  0x56313663 in ?? ()
#2  0x61613447 in ?? ()
#3  0x63365f34 in ?? ()
#4  0x63363136 in ?? ()
#5  0x345a3136 in ?? ()
#6  0x614c614c in ?? ()
#7  0x695f5f36 in ?? ()
#8  0x5a74696e in ?? ()
#9  0x08108500 in ?? ()
#10 0x0819ef00 in ?? ()
#11 0x778c9568 in ?? ()
#12 0x080928da in ?? ()
#13 0x0000000d in ?? ()
#14 0x0819ef00 in ?? ()
#15 0x00000000 in ?? ()
(gdb) 


-- 
Dec 28 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=698


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WORKSFORME                  |DUPLICATE




------- Comment #6 from thomas-dloop kuehne.cn  2007-02-27 18:36 -------


*** This bug has been marked as a duplicate of 825 ***


-- 
Feb 27 2007