[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem in library code using library functions
From: |
Andreas Jaeger |
Subject: |
Re: Problem in library code using library functions |
Date: |
05 Feb 2001 23:23:06 +0100 |
User-agent: |
Gnus/5.090001 (Oort Gnus v0.01) XEmacs/21.1 (Channel Islands) |
"Paolo Faraboschi" <address@hidden> writes:
> Here's a symptom of a problem that may be the proverbial "tip of the
> iceberg"...
> The following seemingly innocuous code hits the assertion (using glibc-2.2 on
> a linux system):
>
> #include <assert.h>
> strrchr() { assert(0); }
> main() {}
>
> The problem is caused by the fact that something in the init
> sequence of libc (set_progname() from assert.c in this specific
> case) calls strrchr(). Now, if I remember correctly what POSIX says,
> programs should be free to redefine the entry point of any function
> (ok, not level-1 OS calls). Libraries should only refer to secondary
> name definitions of whatever they need for themselves. This is
> clearly not true here. After a quick inspection, I have the
> impression that the polluted name space is actually quite large.
Where is this specified by POSIX? Please give me the reference -
without any normative reference there will not be any change in this
area.
ISO C 99 defines strrchr and thereby AFAIU forbids such redefinition
in user space.
Andreas
--
Andreas Jaeger
SuSE Labs address@hidden
private address@hidden
http://www.suse.de/~aj