[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: glibc bug?



On Wed, Dec 14, 2005 at 11:10:41AM +0300, Basil K wrote:
> Hi,
> 
> I just to try compile example from OProfile docs with strfry(char *) function.
> Seg fault occured when I run result program.
> 
> Is there error of my system (Acer aspire 1520), or Debian etch for
> AMD64 platform?
> 
> This is listing of program:
> 
> #include <string.h>
> 
> int main()
> {
>   char string[ ] = "abcdefjh";
> 
>   strfry(string);
>   return 0;
> }

 Does compiling with -fwritable-strings make it work?  I was going to point
out how string constants were stored, etc, but then I noticed that it's a
char [] not a char *.  So maybe there's a gcc bug.  BTW, compiles ok for me
on i386 sarge and on amd64 gcc-3.4 (on a workstation I installed for a
postdoc, which is now horribly out of date.  That gcc-3.4 branch probably
isn't still being maintained, is it :(
 

-- 
#define X(x,y) x##y
Peter Cordes ;  e-mail: X(peter@cor , des.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BC



Reply to: