Topic: Long identifiers, part 1
Author: Mika Moilanen <mika.moilanen@stybba.ntc.nokia.com>
Date: 1998/11/28 Raw View
egcs-2.90.27 980315 (egcs-1.0.2 release) compiles the program fine.
Mika
--
---------------------------------------------------------------------
Mika Moilanen Hiomo 5/1 Voice: +358-9-511 23587
Nokia Telecommunications P.O. Box 315 Fax: +358-9-511 63310
NWS/NMS/NMS for Data 00045 NOKIA Group mika.moilanen@
FINLAND shire.ntc.nokia.com
---------------------------------------------------------------------
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: David R Tribble <david.tribble@noSPAM.central.beasys.com>
Date: 1998/11/11 Raw View
Annex B of the ISO C++ standard (ISO/IEC 14882:1998(E)), entitled
"Implementation quantities", describes some guidelines for minimum
sizes for several implementations limits. In particular, it
recommends this minimum limit:
- 1024 initial characters in an internal identifier or macro
name.
Given this limitation, I've devised a simple test program with
which to judge compiler conformance. I'm curious as to how many
compilers can compile the program (I've tested five and they all
can). Source code follows (and can also be found at
http://www.flash.net/~dtribble/src/bigid1.cpp).
-- David R. Tribble, dtribble@technologist.com --
//======================================================================
// bigid1.cpp
// Test program to demonstrate ISO standard recommendations for
// minimum identifier lengths.
//
// References
// ISO/IEC 14882:1998(E), Annex B.
//
// 1.00, 1998-10-15, David R Tribble.
// First cut.
//
// Written by David R. Tribble, 1998.
// This source code is in the public domain.
//----------------------------------------------------------------------
// Preprocessor macro magic
#define K(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
a##b##c##d##e##f##g##h##i##j##k##l##m##n##o##p
#define A1024 \
K(A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234,\
A234567890123456789012345678901234567890123456789012345678901234)
// A 1024-character name
//----------------------------------------------------------------------
// Class A2345678901234567890123456789012...
// This class has a name that is 1024 characters long.
//----------------------------------------------------------------------
class A1024
{
public:
static int s_mem;
int m_mem;
};
//----------------------------------------------------------------------
// big_named_objectA
// This is an instance of the class declared above.
//
// If this object (which has external linkage) is successfully
// instantiated, then the compiler appears to properly support very
// long identifiers.
//----------------------------------------------------------------------
/*static*/ int A1024::s_mem = 123;
static class A1024 big_named_objectA;
//----------------------------------------------------------------------
// ::main()
// Dummy entry function.
//----------------------------------------------------------------------
int main()
{
return (0);
}
// End bigid1.cpp
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: stephen.clamage@sun.com (Steve Clamage)
Date: 1998/11/11 Raw View
David R Tribble <david.tribble@noSPAM.central.beasys.com> writes:
>//======================================================================
>// bigid1.cpp
>// Test program to demonstrate ISO standard recommendations for
>// minimum identifier lengths.
Sun C++ handles this example with no problems. (We routinely
test with much longer names.)
--
Steve Clamage, stephen.clamage@sun.com
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: "Paul D. DeRocco" <pderocco@ix.netcom.com>
Date: 1998/11/12 Raw View
David R Tribble wrote:
>
> Annex B of the ISO C++ standard (ISO/IEC 14882:1998(E)), entitled
> "Implementation quantities", describes some guidelines for minimum
> sizes for several implementations limits. In particular, it
> recommends this minimum limit:
>
> - 1024 initial characters in an internal identifier or macro
> name.
>
> Given this limitation, I've devised a simple test program with
> which to judge compiler conformance. I'm curious as to how many
> compilers can compile the program (I've tested five and they all
> can). Source code follows (and can also be found at
> http://www.flash.net/~dtribble/src/bigid1.cpp).
[snip]
I suppose it's possible that a particular compiler might handle external
names up to 1024 chars, but barf if the internal mangled name of a
function reaches that length. But it doesn't seem likely.
--
Ciao,
Paul
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]
Author: jcoffin@taeus.com (Jerry Coffin)
Date: 1998/11/12 Raw View
In article <3649EF03.43BF@noSPAM.central.beasys.com>,
david.tribble@noSPAM.central.beasys.com says...
>
> Annex B of the ISO C++ standard (ISO/IEC 14882:1998(E)), entitled
> "Implementation quantities", describes some guidelines for minimum
> sizes for several implementations limits. In particular, it
> recommends this minimum limit:
>
> - 1024 initial characters in an internal identifier or macro
> name.
MSVC++ compiles bigid1 successfully, but warns that the names have
been truncated to 255 characters in the debug information.
It dies on the nested classes in bigid2.
egcs 1.1 compiles bigid1 successfully. It dies on bigid2 saying that
(a very long name elided) does not have a nested type named
big_named_objectB.
Unfortunately, I've just gotten a new computer and don't have the
Intel reference compiler installed at the moment, so I can't tell you
what it'll do right now.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]