Subject: Re: Global variable name which equals to func name causes coredump(gcc).
To: None <>
From: Valeriy E. Ushakov <>
List: tech-userlevel
Date: 09/27/2007 17:57:45
Pelle Johansson <> wrote:

> 27 sep 2007 kl. 13.49 skrev Greg Troxel:
>>   Obviously fread called the wrong func address of read.
>> To answer if this is a bug, I think you'll need to read the C standard
>> very carefully.  read(2) is not part of C; man 2 read says it's in  
>> POSIX.1.
>> But fread is part of C89.
> Which indicates that it is indeed a bug, and probably one not that  
> difficult to fix, by having fread call some alias of read instead. Of  
> course, it gets more complicated when the same has to be done for all  
> possible conflicts.

Hmm, strange.  The example works on my sh3 system where __sread calls
_read (weak alias to _sys_read - the actual syscall), but fails as you
described on my macppc where __sread calls read directly.

SY, Uwe
--                       |       Zu Grunde kommen          |       Ist zu Grunde gehen