473,387 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Interesting conclusion

Well,
I don't know if this is 100% true and all comments are welcome.

I built statically linked MFC DLL as shell extension.
One function generated stack overflow all the time.
DEBUGGING function was looking like this:
void My_Func(_TCHAR *str1, _TCHAR *str2, _TCHAR arr[][256])
{
My_Func(str1, str2, arr);
{
char CharMap[(_TCHAR)-1];
}
}
this function generate STACK OVERFLOW after SECOND call to itself.
So I concluded that statically linked DLL includes ALL variables from
function, no matter what scope are they in.
I wrote second function :
void My_Func(_TCHAR *str1, _TCHAR *str2, _TCHAR arr[][256])
{
My_Func(str1, str2, arr);
{
char *CharMap;
CharMap = (_TCHAR *)malloc((_TCHAR)-1);
free(CharMap);
}
}
and it works fine! (it work for at least 30 calls to itself)

Am I correct in my assumption(conclusion)?

Thanks
Nov 16 '05 #1
0 969

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

50
by: Edward K. Ream | last post by:
I would like to say a few (actually more than a few) words here about some recent discoveries I have made concerning the interaction of Leo and Python. If you don't want to hear an inventor enthuse...
8
by: Bruno R. Dias | last post by:
Perhaps it would be interesting to program a virtual machine simulating an ancient computer (such as the pdp-7). Then, it would be rather interesting to code for it (porting gcc to it maybe?). I...
8
by: adrien | last post by:
Thanks for all the answers about how to hide scrollbars in netscape. The conclusion is that it's not possible. My initial purpose is to compare some Netscape and IE possibilities and it's the...
12
by: rawrite | last post by:
I am just finishing watching a documentary about Rod Serling. It was cool, but after 20 minutes it got boring and all I wanted to do is subscribe to Net Flix and rent the Twilight Zone episodes....
12
by: Davy | last post by:
I found a interesting pointer problem. What does the pointer mean? EXTERN short (*blocks); And what does the malloc mean? blocks = (short (*))malloc(count*sizeof(short )); Any suggestions...
3
by: eBob.com | last post by:
Is there a namespace of interesting and important constants such as maximum length of a filename, maximum length of a path, maximum and minimum values which can be held by a Long (and other data...
27
by: Frederick Gotham | last post by:
I thought it might be interesting to share experiences of tracking down a subtle or mysterious bug. I myself haven't much experience with tracking down bugs, but there's one in particular which...
66
by: prady | last post by:
hi all, could any one solve the following C program. If any one knows the answer please post it Ques: A C function that will print 1 to N one per each line on the stdout , where N is a int...
126
by: jacob navia | last post by:
Buffer overflows are a fact of life, and, more specifically, a fact of C. All is not lost however. In the book "Value Range Analysis of C programs" Axel Simon tries to establish a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.