Re: g_utf8_offset_to_pointer benchmark



...

int
main ()
{
  (void)behdad_utf8_offset_to_pointer ("xxxxxxxxxx" + 1, 5);
  return 0;
}



troll:~> gcc -g -Wall -O2 behdad.c
behdad.c: In function `behdad_utf8_offset_to_pointer':
behdad.c:35: warning: return discards qualifiers from pointer target type
troll:~> ./a.out
Bus Error (core dumped)
troll:~> gdb a.out core
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.6"...
Core was generated by `./a.out'.
Program terminated with signal 10, Bus Error.
Reading symbols from /usr/lib/libc.so.1...done.
Reading symbols from /usr/lib/libdl.so.1...done.
Reading symbols from /usr/platform/SUNW,Sun-Fire/lib/libc_psr.so.1...done.
#0  behdad_utf8_offset_to_pointer (str=0x10669 "xxxxxxxxx", offset=5)
at behdad.c:19
19          register WORDTYPE w = *ws++;



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