#include #include #include #include #include #include #define PERROR(appel) errno = 0; appel; print_error("- " #appel) static void print_error(char *source) { int e = errno; perror(source); printf("errno: %d -- \"%s\"\n\n", e, strerror(e)); } int main(void) { PERROR(acos(2.0)); PERROR(fopen("/", "w")); PERROR(fopen("?", "r")); PERROR(strtol("1234567890", 0, 0)); PERROR(strtol("12345678900", 0, 0)); PERROR(setlocale(LC_ALL, "??")); PERROR(malloc(100000000000)); PERROR(malloc(1000000000000)); return EXIT_SUCCESS; }