 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
AB Guest
|
Posted: Thu Jul 13, 2006 9:10 am Post subject: Program size limitation |
|
|
Hello all,
I heard once that there is a limitation on the number of lines of code
that a program can have when using C, but not for C++. Is this true?
Any ideas? |
|
| Back to top |
|
 |
jacob navia Guest
|
Posted: Thu Jul 13, 2006 9:10 am Post subject: Re: Program size limitation |
|
|
AB a écrit :
| Quote: | Hello all,
I heard once that there is a limitation on the number of lines of code
that a program can have when using C, but not for C++. Is this true?
Any ideas?
|
Some compilers (like MSVC 6.0 for instance) would have problems
when compiling sources with more than 65535 lines. This is due
to the debug information format that MSVC was using some years ago.
Other compilers have no practical limits, even if the OS can have some
limitations.
Gcc under windows (mingw) stops at more than 65535 relocations in an
object module. lcc-win32 had this limit some years ago but I took it
away, maybe mingw has done that too, I do not know.
Of course there is the limitations of disk space (I think that above
1000 million lines your hard disk starts getting full) and there is some
limitations in executable size: under 32 bits systems you usually
can't have a program of more than 2GB size (2GB reserved for the
system) or at most 3GB... This surely puts a stop in the number of lines
of code your program can have. 64 bits systems do not have that
limitation but may have others, since no one has implemented a full
64 bit virtual space yet.
jacob |
|
| Back to top |
|
 |
Ian Collins Guest
|
Posted: Thu Jul 13, 2006 9:10 am Post subject: Re: Program size limitation |
|
|
AB wrote:
| Quote: | Hello all,
I heard once that there is a limitation on the number of lines of code
that a program can have when using C, but not for C++. Is this true?
Depends on your compiler. |
--
Ian Collins. |
|
| Back to top |
|
 |
Keith Thompson Guest
|
Posted: Thu Jul 13, 2006 9:10 am Post subject: Re: Program size limitation |
|
|
"AB" <abjbhat (AT) gmail (DOT) com> writes:
| Quote: | I heard once that there is a limitation on the number of lines of code
that a program can have when using C, but not for C++. Is this true?
Any ideas?
|
The C standard imposes no specific limit on the number of lines either
in a translation unit or in a program. A compiler could impose such a
limit, I suppose, but there's no particular reason to do so (unless
it's a cripped demo). As far as I know, it's the same for C++.
--
Keith Thompson (The_Other_Keith) kst-u (AT) mib (DOT) org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|