Unnested loops and /Zm... wheres it gone?

Im experincing a problem using Nvidia's extension generation header glh_genext.h which has over 250 unnested loops (produces error C1061). In previous versions of .net increasing the heap size using /Zm resolved this, whereas in 2005 /Zm neither solves this nor is documented as solving this. Anyone know of any workarounds? Surely the unnested loop limit CANT be constant?

Thanks


Adam Vanner
[456 byte] By [AdamVanner] at [2007-12-16]
# 1

Are you using VC8.0?

/Zm makes you specify a scaling factor that determines the compiler's memory allocation limit for the precompiled header.

C1061 should only be issued if nesting of code blocks exceeds the limit of 128 nesting levels (an not unnested loops).

Could you please provide a repro case by preprocessing the file causing the problem (to preprocess the file, use the /P compiler option).

Thanks,
Ayman shoukry
VC++

AymanShoukry at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 2

Thanks for your reply-

C1061 is being generated by a 265kb source file (from NVidia OGL SDK, glh_genext.h), so I won't be able to post it all- however, heres a random snippet- the file goes on in this way- it uses macros for wglGetProcAddress to defne requested extension function pointers. Havent counted the number of (un)nests (obviously dependant on the number of extensions allowed) but as its a 265kb file, theres probably more than 250.
Using /Zm"500" definately fixed this in vc7.0, and doesn't in 8.0

And yes, I am using vc8.

Thanks a bunch
Ad
...

#ifdef GL_ARB_shadow

} else if (0 == strcmp(extension, "GL_ARB_shadow")) {

#endif

#ifdef GL_ARB_shadow_ambient

} else if (0 == strcmp(extension, "GL_ARB_shadow_ambient")) {

#endif

#ifdef GL_ARB_texture_border_clamp

} else if (0 == strcmp(extension, "GL_ARB_texture_border_clamp")) {

#endif

#ifdef GL_ARB_texture_compression

} else if (0 == strcmp(extension, "GL_ARB_texture_compression")) {

GLH_EXT_NAME(glCompressedTexImage3DARB) = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexImage3DARB");

if (NULL == GLH_EXT_NAME(glCompressedTexImage3DARB))

return GL_FALSE;

GLH_EXT_NAME(glCompressedTexImage2DARB) = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexImage2DARB");

if (NULL == GLH_EXT_NAME(glCompressedTexImage2DARB))

return GL_FALSE;

GLH_EXT_NAME(glCompressedTexImage1DARB) = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexImage1DARB");

if (NULL == GLH_EXT_NAME(glCompressedTexImage1DARB))

return GL_FALSE;

GLH_EXT_NAME(glCompressedTexSubImage3DARB) = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexSubImage3DARB");

if (NULL == GLH_EXT_NAME(glCompressedTexSubImage3DARB))

return GL_FALSE;

GLH_EXT_NAME(glCompressedTexSubImage2DARB) = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexSubImage2DARB");

if (NULL == GLH_EXT_NAME(glCompressedTexSubImage2DARB))

return GL_FALSE;

GLH_EXT_NAME(glCompressedTexSubImage1DARB) = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)GLH_EXT_GET_PROC_ADDRESS("glCompressedTexSubImage1DARB");

if (NULL == GLH_EXT_NAME(glCompressedTexSubImage1DARB))

return GL_FALSE;

GLH_EXT_NAME(glGetCompressedTexImageARB) = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetCompressedTexImageARB");

if (NULL == GLH_EXT_NAME(glGetCompressedTexImageARB))

return GL_FALSE;

#endif

#ifdef GL_ARB_texture_cube_map

} else if (0 == strcmp(extension, "GL_ARB_texture_cube_map")) {

#endif

#ifdef GL_ARB_texture_env_add

} else if (0 == strcmp(extension, "GL_ARB_texture_env_add")) {

#endif

#ifdef GL_ARB_texture_env_combine

} else if (0 == strcmp(extension, "GL_ARB_texture_env_combine")) {

#endif

...

AdamVanner at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 3
I believe /Zm is unrelated to the nested limit of blocks. My understanding is that the limit have always been 128.

/Zm only affects the max memory alloc for precompiled headers.

Are you sure the header didn't change?

Thanks,
Ayman Shoukry
VC++

AymanShoukry at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ Language...