| 299 | } |
| 300 | |
| 301 | static void warn(const char *format,...) |
| 302 | { |
| 303 | va_list args; |
| 304 | DBUG_PRINT("error", ("%s", format)); |
| 305 | va_start(args,format); |
| 306 | vfprintf(stderr, format, args); |
| 307 | fflush(stderr); |
| 308 | va_end(args); |
| 309 | |
| 310 | #ifdef HAVE_BACKTRACE |
| 311 | { |
| 312 | void *frame[SF_REMEMBER_FRAMES + SF_FRAMES_SKIP]; |
| 313 | int frames= backtrace(frame, array_elements(frame)); |
| 314 | fprintf(stderr, " at "); |
| 315 | if (frames < SF_REMEMBER_FRAMES + SF_FRAMES_SKIP) |
| 316 | frame[frames]= 0; |
| 317 | print_stack(frame + SF_FRAMES_SKIP); |
| 318 | } |
| 319 | #endif |
| 320 | } |
| 321 | |
| 322 | static int bad_ptr(const char *where, void *ptr) |
| 323 | { |
no test coverage detected