__assert - { char buf[256]; snprintf(buf, sizeof(buf),...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> /* * Function that gets called when an assert() fails. * Print a message to stderr and bail out of the program. */ void __bad_assert(const char *file, int line, const char *expr)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { char buf[256]; snprintf(buf, sizeof(buf), "Assertion failed: %s (%s line %d)\n", expr, file, line); write(STDERR_FILENO, buf, strlen(buf)); abort(); }...
View Full Document

This note was uploaded on 11/10/2009 for the course CS 536 taught by Professor Lums during the Spring '09 term at Indiana.

Ask a homework question - tutors are online