> > Ignore it. It makes it impossible to use MallocDebug with your app, but
> > otherwise it's harmless AFAIK
[quoted text clipped - 14 lines]
> either MSL or BSD. Thus when the function is called, the app jumps off
> into the weeds.

Signature
If this message helped you, consider buying an item
from my wish list: <http://artins.org/ben/wishlist>
I changed my name: <http://periodic-kingdom.org/People/NameChange.php>
> I do not believe your explanation is correct.
Maybe so, but the exact mechanism of the crash is irrelevant. Calling
a nonexistent function is going to crash one way or another. That isn't
the problem. The problem is that the code for isdigit() and friends
isn't being linked into the app.
> Because the function is marked inline in CW headers.
Exactly how would that make the linker think that a *call* to isdigit()
is the *definition* of isdigit()?
> It is completely impossible to use MW standard library on Mac OS X if
> you have a no-linker-warnings policy. Sorry.
Actually, a few benign warnings wouldn't matter, since all I want is is
the convenience of using the CW debugger for a brief time. But you say
this as if it were a widely-known fact. Where may I find documentation
of this? If MSL always causes linker warnings on OS X, I'd like to know
exactly which ones, so as to which are benign and which aren't.
Clearly, the ones I'm experiencing are not.
My guess that one of the following is true:
> a) Other project doesn't use isdigit, and hence it's not inlined
Um, as originally stated, I *added* isdigit() to the other test project
(built from stationery). It runs fine and has no warnings.
> b) Other project doesn't use MW standard library (uses Apple's instead)
Nope. The test project was created from Mach-O stationery, and
MSL_ALL_Mach-O_D.lib is in the project.
> c) Other project has inlining turned off
Inlining is OFF in both projects. Strike three.
> d) Phase of the moon :-)
Brilliant. Thanks.
bill - 09 Feb 2006 07:08 GMT
For anyone who might run into this problem, I was able to solve it by
bailing on MSL and using BSD.
The Access Paths which worked are:
{Compiler}MacOS X Support/Headers/(wchar_t Support fix)
{OS X Volume}usr/include
{OS X Volume}usr/lib
{Compiler}MacOS X Support (recursive)
{OS X Volume}System/Library/Frameworks (marked with framework "f" symbol)
The Mach-O project now compiles and links with no errors or warnings
and runs fine.
If anyone reads this and has factual information on how to use
isdigit() and other ctype functions with CW 10 and MSL without getting
link errors, I'd be happy to learn it. Not really interested in SWAGs
involving stumpwater at midnight under a full moon, etc.
Ben Artin - 09 Feb 2006 08:53 GMT
> > I do not believe your explanation is correct.
>
> Maybe so, but the exact mechanism of the crash is irrelevant. Calling
> a nonexistent function is going to crash one way or another. That isn't
> the problem. The problem is that the code for isdigit() and friends
> isn't being linked into the app.
I believe you are wrong about the function being non-existed, and if you take
the time to check I suspect you will find out that isdigit exists and is
actually crashing.
> > Because the function is marked inline in CW headers.
>
> Exactly how would that make the linker think that a *call* to isdigit()
> is the *definition* of isdigit()?
You are confused about what I am saying. Since isdigit is inline, the compiler
generates a copy of the code for isdigit() while compiling your source code, and
that copy of code for isdigit() is reported as being "in yourfile.c". The other
copy is in the system framework, and linker subsequently gives you a warning for
duplicate definitions.
> > It is completely impossible to use MW standard library on Mac OS X if
> > you have a no-linker-warnings policy. Sorry.
[quoted text clipped - 5 lines]
> exactly which ones, so as to which are benign and which aren't.
> Clearly, the ones I'm experiencing are not.
The warnings themselves are benign here. All that the warning says is that the
compiler included isdigit() in the object code generated for your source file
(as expected for an inline function) and that isdigit() is also present in the
system framework. This is not a cause for concern in an of itself. Something
else is going on that is causing your crash.
The fact that MSL gives you duplicate symbol warnings is, indeed, well-known, by
which I mean "it's been bitched about on Usenet more than once". I don't mean to
imply that you should have known this before asking your question -- previous
complaints have involved any number of dozens of other inline functions in MSL.
> My guess that one of the following is true:
> >
[quoted text clipped - 15 lines]
>
> Brilliant. Thanks.
Is isdigit() in the crashing project being called before main()? MSL isdigit()
depends on a lookup table that I believe is stored in thread-local data; if said
thread local data is uninitialized, or if the attempt to initialize it failed,
you may end up deferencing page 0 from inside isdigit() and crashing.
Ben

Signature
If this message helped you, consider buying an item
from my wish list: <http://artins.org/ben/wishlist>
I changed my name: <http://periodic-kingdom.org/People/NameChange.php>