Xref: utzoo comp.lang.c:35907 comp.os.msdos.programmer:3216 comp.os.os2.misc:659 comp.os.os2.programmer:436 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!bywater!arnor!larios!db3l From: db3l@ibm.com (David Bolen) Newsgroups: comp.lang.c,comp.os.msdos.programmer,comp.os.os2.misc,comp.os.os2.programmer Subject: Re: Copiling warning, C4058 of MSC V5.1 - DS != SS Message-ID: Date: 7 Feb 91 16:42:57 GMT References: <1991Feb6.091030.27891@hellgate.utah.edu> <1991Feb6.180813.12005@unixg.ubc.ca> Sender: news@arnor.uucp (NNTP News Poster) Organization: Laboratory Automation, IBM Thomas J. Watson Research Center Lines: 42 In-Reply-To: ballard@cheddar.ucs.ubc.ca's message of 6 Feb 91 18:08:13 GMT In article <1991Feb6.180813.12005@unixg.ubc.ca> ballard@cheddar.ucs.ubc.ca (Alan Ballard) writes: >In article <1991Feb6.091030.27891@hellgate.utah.edu> h-lee%hogum.utah.edu@cs.utah.edu (LEE Hyo Jong) writes: >>I got the warning of 'address of frame variable taken, DS!=SS'. >>It usually happens when I calls the math lib functions such as >>pow() or sin() or when I manipulate three dimensional arrays. >>Since I am using multithread, one of my compile options(MSC V5.1) is >>-Aluf. > >Hm, this should only happen if you're passing a near pointer, which >shouldn't occur with -Aluf. Is it possible the functions involved >have explicit "near" attributes for parameters etc.? Unfortunately, one of the bugs in MSC 5.1 (not sure about 6.0, but it's got enough of its own to worry about), was that when using -Alfu that particular warning is displayed when it really isn't true. Apparently the compiler should print the warning except in cases when -Alfu is being used, but Microsoft missed a check for those options and displays the warning anyway. This generally happens when creating multithread programs, but it can also happen with basic PM programs (where the window procedures also need -Alfu since they run with SS != DS). Unfortunately, this makes this warning difficult to trust. The best thing I can suggest is to verify your use of local variables, but for the most part, if using -Alfu, ignore the warning, since you know you've told the compiler not to assume SS == DS for your functions. -- -- David -- /-----------------------------------------------------------------------\ \ David Bolen / | Laboratory Automation, IBM Thomas J. Watson Research Center | / P.O. Box 218, Yorktown Heights, NY 10598 \ | - - - - - - - - - - - - M i t h r a n d i r - - - - - - - - - - - - | | Internet : db3l@ibm.com | Bitnet : db3l@yktvmv | | Usenet : uunet!bywater!arnor!larios!db3l | Phone : (914) 945-1940 | | /---------------------------------------------------------------\ | \-( All comments/opinions are mine and don't represent those of IBM )-/ \---------------------------------------------------------------/