|
From: Mike H. <mi...@co...> - 2012-04-23 00:42:17
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Eli Zaretskii wrote:
<blockquote cite="mid:83b...@gn..." type="cite">
<blockquote type="cite">
<pre wrap="">
Is there a page or document anywhere that lists C and C++ compiler
limits for the MinGW ports? ...</pre>
</blockquote>
</blockquote>
<blockquote cite="mid:83b...@gn..." type="cite">
<pre wrap="">
Why do you assume there are fixed limits? The GNU project frowns on
fixed limits, so generally only the available system resources (like
available virtual memory etc.) will determine where a compiler or a
program barf.
</pre>
</blockquote>
I assume so because there generally are hard limits. They may not be
documented, but they're usually there. Especially in C and C++ where
the compiler's choice for "size_t" puts a cap on the largest possible
object, and the choice for ptrdiff_t puts a limit on the maximum
dimensioned size of an array. For a Win32 target, the usual choice of
a 32-bit unsigned size_t is no help. That's maximum is 4GB-1, but no
allocated memory block can be as large as 2GB on Win32. <br>
<br>
If system memory availability is the limit, and nothing else, that
would be nice to know. The rationale for having advertised limits (or
non-limits) is so that the developer knows
that an application will compile if those limits are respected, and
will continue to do so in future releases.<br>
<br>
Everybody agrees that an int[1024] array is trivially practical, and
everybody should have a notion that int[0x3FFFFFFF] is unreasonable on
Win32, even though that's within size_t and ptrdiff_t limits.
Somewhere in between is a minimum unreasonable array size. :o)<br>
<br>
<blockquote cite="mid:83b...@gn..." type="cite">
<pre wrap="">For automatic variables, the size of the stack matters (2MB(?) by
default, I think), but you can change that via a linker switch.
</pre>
</blockquote>
I figured...but thanks for the info!<br>
<br>
Cheers,<br>
Mike<br>
<br>
<b><small>Michael J. Housky<br>
something-or-another, emeritus</small></b>
<pre wrap=""></pre>
<br>
</body>
</html>
|